-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add credential definition (#109)
Because - credential definition needs for both frontend and backend validation This commit - add Gcloud credential definition user account and service account
- Loading branch information
Showing
8 changed files
with
447 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft-07/schema", | ||
"$id": "https://github.com/instill-ai/model-backend/blob/main/config/credential/gcs_user_account.json", | ||
"type": "object", | ||
"title": "GCS User Account", | ||
"description": "The GCS user account structure", | ||
"additionalProperties": false, | ||
"required": ["type", "project_id", "private_key_id", "private_key", "client_email", "client_id", "auth_uri", "token_uri", "auth_provider_x509_cert_url", "client_x509_cert_url"], | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"title": "The account type", | ||
"description": "The account type", | ||
"readOnly": true, | ||
"ui_order": 0, | ||
"ui_hidden": false, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
}, | ||
"project_id": { | ||
"type": "string", | ||
"title": "Project ID", | ||
"description": "The project ID", | ||
"readOnly": true, | ||
"ui_order": 1, | ||
"ui_hidden": true, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
}, | ||
"private_key_id": { | ||
"type": "string", | ||
"title": "Private key ID", | ||
"description": "The private key ID", | ||
"readOnly": true, | ||
"ui_order": 2, | ||
"ui_hidden": true, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
}, | ||
"private_key": { | ||
"type": "string", | ||
"title": "Private key", | ||
"description": "The private key", | ||
"readOnly": true, | ||
"ui_order": 3, | ||
"ui_hidden": true, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
}, | ||
"client_email": { | ||
"type": "string", | ||
"title": "Client email", | ||
"description": "The client email", | ||
"readOnly": true, | ||
"ui_order": 4, | ||
"ui_hidden": true, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
}, | ||
"client_id": { | ||
"type": "string", | ||
"title": "Client ID", | ||
"description": "The client ID", | ||
"readOnly": true, | ||
"ui_order": 5, | ||
"ui_hidden": true, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
}, | ||
"auth_uri": { | ||
"type": "string", | ||
"title": "Auth URI", | ||
"description": "The auth URI", | ||
"readOnly": true, | ||
"ui_order": 6, | ||
"ui_hidden": true, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
}, | ||
"token_uri": { | ||
"type": "string", | ||
"title": "Token URI", | ||
"description": "The token URI", | ||
"readOnly": true, | ||
"ui_order": 7, | ||
"ui_hidden": true, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
}, | ||
"auth_provider_x509_cert_url": { | ||
"type": "string", | ||
"title": "Auth provider x509 cert url", | ||
"description": "The auth provider x509 cert url", | ||
"readOnly": true, | ||
"ui_order": 8, | ||
"ui_hidden": true, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
}, | ||
"client_x509_cert_url": { | ||
"type": "string", | ||
"title": "client x509 cert url", | ||
"description": "The client x509 cert url", | ||
"readOnly": true, | ||
"ui_order": 9, | ||
"ui_hidden": true, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
} | ||
} | ||
} | ||
|
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,52 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft-07/schema", | ||
"$id": "https://github.com/instill-ai/model-backend/blob/main/config/credential/gcs_user_account.json", | ||
"type": "object", | ||
"title": "GCS User Account", | ||
"description": "The GCS user account structure", | ||
"additionalProperties": false, | ||
"required": ["type", "client_id", "client_secret", "refresh_token"], | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"title": "The account type", | ||
"description": "The account type", | ||
"readOnly": true, | ||
"ui_order": 0, | ||
"ui_hidden": false, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
}, | ||
"client_id": { | ||
"type": "string", | ||
"title": "Client ID", | ||
"description": "The client ID", | ||
"readOnly": true, | ||
"ui_order": 1, | ||
"ui_hidden": true, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
}, | ||
"client_secret": { | ||
"type": "string", | ||
"title": "Client secret", | ||
"description": "The client secret", | ||
"readOnly": true, | ||
"ui_order": 2, | ||
"ui_hidden": true, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
}, | ||
"refresh_token": { | ||
"type": "string", | ||
"title": "Refresh token", | ||
"description": "The refresh token", | ||
"readOnly": true, | ||
"ui_order": 3, | ||
"ui_hidden": true, | ||
"ui_disabled": true, | ||
"ui_component": "text" | ||
} | ||
} | ||
} | ||
|
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,182 @@ | ||
- id: "gcs" | ||
uid: "909c3278-f7d1-461c-9352-87741bef11d3" | ||
title: "GCS" | ||
documentationUrl: "https://docs.instill.tech/credentials/definitions/gcs" | ||
icon: "gcs.svg" | ||
UserAccount: | ||
$schema: "http://json-schema.org/draft-07/schema#" | ||
title: "Credential spec for user account credential in gcloud" | ||
type: "object" | ||
required: | ||
- "type" | ||
- "client_id" | ||
- "client_secret" | ||
- "refresh_token" | ||
additionalProperties: false | ||
properties: | ||
type: | ||
type: "string" | ||
title: "The account type" | ||
description: "The account type" | ||
examples: | ||
- "authorized_user" | ||
readOnly: true | ||
ui_order: 0 | ||
ui_hidden: false | ||
ui_disabled: true | ||
ui_component: "text" | ||
client_id: | ||
type: "string" | ||
title: "Client ID" | ||
description: "The client ID" | ||
examples: | ||
- "32525940519.apps.googleusercontent.com" | ||
ui_order: 1 | ||
ui_hidden: true | ||
ui_disabled: true | ||
ui_component: "text" | ||
client_secret: | ||
type: "string" | ||
title: "Client secret" | ||
description: "The client secret" | ||
examples: | ||
- "ZmssLNjJy2998hD4CTg2ejr2" | ||
readOnly: true | ||
ui_order: 2 | ||
ui_hidden: true | ||
ui_disabled: true | ||
ui_component: "text" | ||
refresh_token: | ||
type: "string" | ||
title: "Refresh token" | ||
description: "The refresh token" | ||
examples: | ||
- "1//0ewHCk-A5UvSzCgYIARAAGA4SNwF-L9Irrff4A3netlFmQ5QxIng_IwSRswKCmzeLNQgiuP3Hd9-tWlkSL5TZzdMIvPpx9rhAH_4" | ||
readOnly: true | ||
ui_order: 3 | ||
ui_hidden: true | ||
ui_disabled: true | ||
ui_component: "text" | ||
ServiceAccount: | ||
$schema: "http://json-schema.org/draft-07/schema#" | ||
title: "Credential spec for service account credential in gcloud" | ||
type: "object" | ||
required: | ||
- "type" | ||
- "project_id" | ||
- "private_key_id" | ||
- "private_key" | ||
- "client_email" | ||
- "client_id" | ||
- "auth_uri" | ||
- "token_uri" | ||
- "auth_provider_x509_cert_url" | ||
- "client_x509_cert_url" | ||
additionalProperties: false | ||
properties: | ||
type: | ||
type: "string" | ||
title: "Service account type" | ||
description: "The service account type" | ||
examples: | ||
- "service_account" | ||
ui_order: 0 | ||
ui_hidden: false | ||
ui_disabled: true | ||
ui_component: "text" | ||
project_id: | ||
type: "string" | ||
title: "Project ID" | ||
description: "The project ID" | ||
examples: | ||
- "vaulted-circle-353902" | ||
ui_order: 1 | ||
ui_hidden: true | ||
ui_disabled: true | ||
ui_component: "text" | ||
private_key_id: | ||
type: "string" | ||
title: "Private key ID" | ||
description: "the private key ID" | ||
examples: | ||
- "288fc2df036c033b352a5d456b84aa80e595bf87" | ||
readOnly: true | ||
ui_order: 2 | ||
ui_hidden: true | ||
ui_disabled: true | ||
ui_component: "text" | ||
private_key: | ||
type: "string" | ||
title: "Private key" | ||
description: "The private key" | ||
readOnly: true | ||
ui_order: 3 | ||
ui_hidden: true | ||
ui_disabled: true | ||
ui_component: "text" | ||
client_email: | ||
type: "string" | ||
title: "Client email" | ||
description: "The client email" | ||
examples: | ||
- "[email protected]" | ||
readOnly: true | ||
ui_order: 4 | ||
ui_hidden: true | ||
ui_disabled: true | ||
ui_component: "text" | ||
client_id: | ||
type: "string" | ||
title: "Client ID" | ||
description: "The client ID" | ||
examples: | ||
- "103361705578220481445" | ||
readOnly: true | ||
ui_order: 5 | ||
ui_hidden: true | ||
ui_disabled: true | ||
ui_component: "text" | ||
auth_uri: | ||
type: "string" | ||
title: "Auth URI" | ||
description: "The auth uri" | ||
examples: | ||
- "https://accounts.google.com/o/oauth2/auth" | ||
readOnly: true | ||
ui_order: 6 | ||
ui_hidden: true | ||
ui_disabled: true | ||
ui_component: "text" | ||
token_uri: | ||
type: "string" | ||
title: "Token URI" | ||
description: "The token uri" | ||
examples: | ||
- "https://oauth2.googleapis.com/token" | ||
readOnly: true | ||
ui_order: 7 | ||
ui_hidden: true | ||
ui_disabled: true | ||
ui_component: "text" | ||
auth_provider_x509_cert_url: | ||
type: "string" | ||
title: "Auth provider x509 cert url" | ||
description: "The auth provider x509 cert url" | ||
examples: | ||
- "https://www.googleapis.com/oauth2/v1/certs" | ||
readOnly: true | ||
ui_order: 8 | ||
ui_hidden: true | ||
ui_disabled: true | ||
ui_component: "text" | ||
client_x509_cert_url: | ||
type: "string" | ||
title: "Client x509 cert url" | ||
description: "The client x509 cert url" | ||
examples: | ||
- "https://www.googleapis.com/robot/v1/metadata/x509/test1-2%40mnist-255101.iam.gserviceaccount.com" | ||
readOnly: true | ||
ui_order: 9 | ||
ui_hidden: true | ||
ui_disabled: true | ||
ui_component: "text" |
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
Oops, something went wrong.