Conversation
This reverts commit 77209fb.
|
The publishable_key, client session, and console session auth are only used from a browser context and thus will only be used by the JS SDK. |
| api_key="seam_at1_shorttoken_longtoken", | ||
| endpoint=f"https://{r}.fakeseamconnect.seam.vc", | ||
| personal_access_token="seam_at1_shorttoken_longtoken", | ||
| workspace_id="seed_workspace_1", |
There was a problem hiding this comment.
This is interesting: Creating a workspace should not be allowed when using a PAT and a workspace ID.
There was a problem hiding this comment.
We should fix the endpoint then. What type of auth should be allowed?
There was a problem hiding this comment.
The auth on that endpoint is PAT without a Workspace. This is correct, since a PAT with a workspace cannot operate or create resources outside of the workspace.
The JS SDK handles this by omitting the method from the Seam class but allowing it for SeamMultiWorkspaces
There was a problem hiding this comment.
Side node, I realize now that the name SeamHttpWorkspaces implies that operations should work for different workspaces, but it really needs to mean the client only provides operations that are "workspace less". Maybe we can think of a better name.
There was a problem hiding this comment.
Got it. So what approach should we take in Python SDK? Ignore /workspaces/create on Seam client and add SeamMultiWorkspace client that will support that endpoint and allow passing PAT without workspace?
razor-x
left a comment
There was a problem hiding this comment.
Looks good. Two main things:
- Let's add the parse_options function, see https://github.com/seamapi/javascript-http/blob/main/src/lib/seam/connect/parse-options.ts#L31-L85
- We should require the workspace_id when using PAT and introduce SeamMultiWorkspace class in another PR.
razor-x
left a comment
There was a problem hiding this comment.
Looks good! Just a few last comments :)
razor-x
left a comment
There was a problem hiding this comment.
Should be good to include in the generator now. Let's export any other custom errors in the generated code.
Enable authenticating Seam client with PAT. Add
Seam.from_personal_access_tokenandSeam.from_api_keystatic methods.