Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
9679b068
Unverified
Commit
9679b068
authored
Jan 22, 2025
by
Antoine Kaufmann
Browse files
symphony/client: separate calls for guest token and link
parent
3fc4a62d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
symphony/client/simbricks/client/client.py
symphony/client/simbricks/client/client.py
+16
-4
No files found.
symphony/client/simbricks/client/client.py
View file @
9679b068
...
...
@@ -27,7 +27,7 @@ import typing
import
contextlib
import
json
from
simbricks.utils
import
base
as
utils_base
from
.auth
import
TokenProvider
from
.auth
import
Token
,
TokenProvider
from
.settings
import
client_settings
from
simbricks.orchestration
import
system
from
simbricks.orchestration
import
simulation
...
...
@@ -198,10 +198,22 @@ class OrgClient:
}
async
with
self
.
_base_client
.
post
(
url
=
self
.
_prefix
(
org
,
"/create-guest"
),
json
=
namespace_json
)
as
resp
:
j
=
await
resp
.
json
()
print
(
j
)
return
await
j
[
"magic_link"
]
await
resp
.
json
()
async
def
guest_token
(
self
,
org
:
str
,
email
:
str
)
->
Token
:
j
=
{
"email"
:
email
,
}
async
with
self
.
_base_client
.
post
(
url
=
self
.
_prefix
(
org
,
"/guest-token"
),
json
=
j
)
as
resp
:
tok
=
await
resp
.
json
()
return
Token
.
parse_from_resp
(
tok
)
async
def
guest_magic_link
(
self
,
org
:
str
,
email
:
str
)
->
str
:
j
=
{
"email"
:
email
,
}
async
with
self
.
_base_client
.
post
(
url
=
self
.
_prefix
(
org
,
"/guest-magic-link"
),
json
=
j
)
as
resp
:
return
(
await
resp
.
json
())[
'magic_link'
]
class
NSClient
:
def
__init__
(
self
,
base_client
:
BaseClient
=
BaseClient
(),
namespace
:
str
=
""
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment