Skip to content

Commit df20294

Browse files
committed
feat: update app agent and fix token
implement ENG-3911
1 parent 23dcdbe commit df20294

37 files changed

+1205
-3156
lines changed

Pipfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ grpcio = "*"
1717
protobuf = "*"
1818
indykite-sdk = {editable = true, path = "."}
1919
requests = "*"
20-
pytest = "*"
21-
pytest-cov = "*"
20+
pytest = "8.0.2"
21+
pytest-cov = "4.1.0"
2222
authlib = "*"
2323
grpcio-tools = "*"
2424
urllib3 = "*"

Pipfile.lock

+174-172
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/spaces/Pipfile.lock

-1,576
This file was deleted.

indykite_sdk/config/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@ def __init__(self, token_source=None):
3838
consent_config, create_consent_config_node,
3939
update_consent_config_node, validate_data_points)
4040
from .create_application_with_agent_credentials import create_application_with_agent_credentials
41-
from .username_policy import username_policy

indykite_sdk/config/application_agent.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@ def read_application_agent_by_name(self, app_space_id, application_agent_name, b
6060
return ApplicationAgent.deserialize(response.application_agent)
6161

6262

63-
def create_application_agent(self, application_id, name, display_name, description="", bookmarks=[]):
63+
def create_application_agent(self,
64+
application_id,
65+
name,
66+
display_name,
67+
description="",
68+
bookmarks=[],
69+
api_permissions=[],
70+
):
6471
"""
6572
create an AppAgent
6673
:param self:
@@ -69,6 +76,7 @@ def create_application_agent(self, application_id, name, display_name, descripti
6976
:param display_name: string
7077
:param description: string
7178
:param bookmarks: list of strings with pattern: ^[a-zA-Z0-9_-]{40,}$
79+
:param api_permissions: list of strings 1 - 64
7280
:return: deserialized CreateApplicationAgentResponse
7381
"""
7482
sys.excepthook = logger.handle_excepthook
@@ -79,7 +87,8 @@ def create_application_agent(self, application_id, name, display_name, descripti
7987
name=name,
8088
display_name=wrappers.StringValue(value=display_name),
8189
description=wrappers.StringValue(value=description),
82-
bookmarks=bookmarks
90+
bookmarks=bookmarks,
91+
api_permissions=api_permissions
8392
)
8493
)
8594
except Exception as exception:

indykite_sdk/config/config_node.py

+33
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def read_config_node(self, config_node_id, bookmarks=[], version=0):
3737
return None
3838
return ConfigNode.deserialize(response.config_node)
3939

40+
4041
def delete_config_node(self, config_node_id, etag, bookmarks=[]):
4142
"""
4243
delete a specific config node
@@ -286,6 +287,38 @@ def validate_conveyance(self, conveyance):
286287
return logger.logger_error(exception)
287288

288289

290+
def validate_user_verification(self, user_verification_requirement):
291+
"""
292+
validate user verification requirement
293+
:param self:
294+
:param user_verification_requirement: string
295+
:return: True if valid or raises error
296+
"""
297+
try:
298+
user_verification_requirements = [u.value for u in UserVerificationRequirement]
299+
if user_verification_requirement not in user_verification_requirements:
300+
raise TypeError("user_verification_requirements must be a member of UserVerificationRequirement")
301+
return True
302+
except Exception as exception:
303+
return logger.logger_error(exception)
304+
305+
306+
def validate_authenticator_attachment(self, authenticator_attachment):
307+
"""
308+
validate authenticator attachment
309+
:param self:
310+
:param authenticator_attachment: string
311+
:return: True if valid or raises error
312+
"""
313+
try:
314+
authenticator_attachments = [a.value for a in AuthenticatorAttachment]
315+
if authenticator_attachment not in authenticator_attachments:
316+
raise TypeError("authenticator_attachment must be a member of AuthenticatorAttachment")
317+
return True
318+
except Exception as exception:
319+
return logger.logger_error(exception)
320+
321+
289322
def validate_data_points(self, data_points):
290323
"""
291324
validate data_points requirement

indykite_sdk/config/username_policy.py

-31
This file was deleted.

indykite_sdk/indykite/auditsink/v1beta1/config_pb2.py

+86-96
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

indykite_sdk/indykite/config/v1beta1/config_management_api_pb2.py

+199-285
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)