-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
441 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from jarvis_sdk.indykite.identity.v1beta1 import identity_management_api_pb2 as pb2 | ||
from google.protobuf import struct_pb2 | ||
|
||
def enrich_token(self, user_token: str, token_claims: dict, session_claims: dict): | ||
try: | ||
token_struct = struct_pb2.Struct() | ||
if token_claims is not None: | ||
token_struct.update(token_claims) | ||
|
||
session_struct = struct_pb2.Struct() | ||
if session_claims is not None: | ||
session_struct.update(session_claims) | ||
|
||
response = self.stub.EnrichToken( | ||
pb2.EnrichTokenRequest( | ||
access_token=user_token, | ||
token_claims=token_struct, | ||
session_claims=session_struct, | ||
) | ||
) | ||
except Exception as exception: | ||
print(exception) | ||
return None | ||
|
||
if not response: | ||
return None | ||
|
||
return response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.