-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Public API/SDK update for /me route to handle extension blacklisted domains. #9688
Conversation
a7e70da
to
2f833cb
Compare
5c1a305
to
545a1a4
Compare
545a1a4
to
b5dfd1c
Compare
segmentation: w.segmentation || null, | ||
whiteListedProviders: w.whiteListedProviders, | ||
defaultEmbeddingProvider: w.defaultEmbeddingProvider, | ||
...(populateExtensionConfig && { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a toJSON
(to align with other resources) on the ExtensionConfigurationResource
and return it instead of accessing property manually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a toJson() but here I'd rather get the resources since I need to access workspaceId that I don't necessarily want to expose in the type. Also, here I only want to display the blacklistedDomains attribute, I don't want the full type. I can't just spread the type because it also has an id and sId and we don't want to conflict with the workspace.
I could put all that in a sub object with a config key but since the relation is 0-1 I like it flat with the workspace!
Description
Changes on Front:
WorkspaceType
can take anextensionBlacklistedDomains
string array.UserTypeWithWorkspace
returns an attachedWorkspaceType
instead ofLightWorkspaceType
./me
route accepts a header"X-Request-Origin"
, if set to extension it will populateextensionBlacklistedDomains
in the response.Changes on Node SDK:
MeResponseSchema
andWorkspaceSchema
to match the changes made on front API.Risk
Should be safe as I'm only adding an optional attribute to an existing type.
Deploy Plan
Next
=> Then I can use the updated SDK on the extension to disable the share buttons if the current domain is from a blacklisted domain.