@@ -706,6 +706,49 @@ def catalog_index_connections(self, connection_names=[], all_connections=False,
706706 "indexingMode" : indexing_mode
707707 })
708708
709+
710+ ########################################################
711+ # Auth
712+ ########################################################
713+
714+ def get_auth_info (self , with_secrets = False ):
715+ """
716+ Returns various information about the user currently authenticated using
717+ this instance of the API client.
718+
719+ This method returns a dict that may contain the following keys (may also contain others):
720+
721+ * authIdentifier: login for a user, id for an API key
722+ * groups: list of group names (if context is an user)
723+ * secrets: list of dicts containing user secrets (if context is an user)
724+
725+ :param: with_secrets boolean: Return user secrets
726+ :returns: a dict
727+ :rtype: dict
728+ """
729+ return self ._perform_json ("GET" , "/auth/info" , params = {"withSecrets" : with_secrets })
730+
731+ def get_auth_info_from_browser_headers (self , headers_dict , with_secrets = False ):
732+ """
733+ Returns various information about the DSS user authenticated by the dictionary of
734+ HTTP headers provided in headers_dict.
735+
736+ This is generally only used in webapp backends
737+
738+ This method returns a dict that may contain the following keys (may also contain others):
739+
740+ * authIdentifier: login for a user, id for an API key
741+ * groups: list of group names (if context is an user)
742+ * secrets: list of dicts containing user secrets (if context is an user)
743+
744+ :param: headers_dict dict: Dictionary of HTTP headers
745+ :param: with_secrets boolean: Return user secrets
746+ :returns: a dict
747+ :rtype: dict
748+ """
749+ return self ._perform_json ("POST" , "/auth/info-from-browser-headers" ,
750+ params = {"withSecrets" : with_secrets }, body = headers_dict )
751+
709752 ########################################################
710753 # Internal Request handling
711754 ########################################################
@@ -769,6 +812,7 @@ def get_object_discussions(self, project_key, object_type, object_id):
769812 """
770813 return DSSObjectDiscussions (self , project_key , object_type , object_id )
771814
815+
772816class TemporaryImportHandle (object ):
773817 def __init__ (self , client , import_id ):
774818 self .client = client
0 commit comments