-
Notifications
You must be signed in to change notification settings - Fork 10
feat(provider): Add Google GCP support #1131
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
Changes from all commits
9f55b91
12c8af0
8942549
799853a
edfa349
b86c913
600379e
248fa2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,8 +84,12 @@ class CredsUpdate(SQLModel): | |
| provider: Provider = Field( | ||
| description="Name of the provider to update/add credentials for" | ||
| ) | ||
| credential: ProviderCredentials = Field( | ||
| description="Credentials for the specified provider", | ||
| credential: CredentialPayload = Field( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why you have change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to make sure partial updates for credentials succeed as opposed to |
||
| description=( | ||
| "Credentials for the specified provider. May be a partial payload " | ||
| "(PATCH semantics) — completeness is validated after merging with " | ||
| "any existing stored credentials, not on this raw payload." | ||
| ), | ||
| ) | ||
| is_active: bool | None = Field( | ||
| default=None, description="Whether the credentials are active" | ||
|
|
@@ -107,15 +111,21 @@ def _parse_credential(cls, data: object) -> object: | |
| if isinstance(nested, dict): | ||
| credential = nested | ||
|
|
||
| # An empty payload has nothing to merge with an existing stored | ||
| # credential, so it is rejected here rather than deferred to the | ||
| # crud-level merge check. | ||
|
Comment on lines
+114
to
+116
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you please remove these unwated comments, becasue the code already readable. |
||
| if isinstance(credential, dict) and not credential: | ||
| parse_provider_credentials(provider_key, credential) | ||
|
|
||
| return { | ||
| **data, | ||
| "provider": provider_key, | ||
| "credential": parse_provider_credentials(provider_key, credential), | ||
| "credential": credential, | ||
| } | ||
|
|
||
| def credential_payload(self) -> CredentialPayload: | ||
| """Credential dict for `provider`, exactly as submitted.""" | ||
| return self.credential.model_dump(exclude_unset=True) | ||
| return self.credential | ||
|
|
||
|
|
||
| class Credential(CredsBase, table=True): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.