add identity provider schema

This commit is contained in:
msukkari 2025-10-30 21:22:25 -07:00
parent 4899c9fbc7
commit 6bc03f7a0e
12 changed files with 5950 additions and 11 deletions

View file

@ -8,7 +8,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"type": { "type": {
"const": "githubApp", "const": "github",
"description": "GitHub App Configuration" "description": "GitHub App Configuration"
}, },
"deploymentHostname": { "deploymentHostname": {
@ -70,7 +70,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"type": { "type": {
"const": "githubApp", "const": "github",
"description": "GitHub App Configuration" "description": "GitHub App Configuration"
}, },
"deploymentHostname": { "deploymentHostname": {

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,7 @@ const schema = {
"type": "object", "type": "object",
"properties": { "properties": {
"type": { "type": {
"const": "githubApp", "const": "github",
"description": "GitHub App Configuration" "description": "GitHub App Configuration"
}, },
"deploymentHostname": { "deploymentHostname": {
@ -69,7 +69,7 @@ const schema = {
"type": "object", "type": "object",
"properties": { "properties": {
"type": { "type": {
"const": "githubApp", "const": "github",
"description": "GitHub App Configuration" "description": "GitHub App Configuration"
}, },
"deploymentHostname": { "deploymentHostname": {

View file

@ -6,7 +6,7 @@ export interface GitHubAppConfig {
/** /**
* GitHub App Configuration * GitHub App Configuration
*/ */
type: "githubApp"; type: "github";
/** /**
* The hostname of the GitHub App deployment. * The hostname of the GitHub App deployment.
*/ */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,275 @@
// THIS IS A AUTO-GENERATED FILE. DO NOT MODIFY MANUALLY!
export type IdentityProviderConfig =
| GitHubIdentityProviderConfig
| GitLabIdentityProviderConfig
| GoogleIdentityProviderConfig
| OktaIdentityProviderConfig
| KeycloakIdentityProviderConfig
| MicrosoftEntraIDIdentityProviderConfig
| GCPIAPIdentityProviderConfig;
export interface GitHubIdentityProviderConfig {
provider: "github";
purpose: "sso" | "identity";
clientId:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
clientSecret:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
baseUrl?:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}
export interface GitLabIdentityProviderConfig {
provider: "gitlab";
purpose: "sso" | "identity";
clientId:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
clientSecret:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
baseUrl:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}
export interface GoogleIdentityProviderConfig {
provider: "google";
clientId:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
clientSecret:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}
export interface OktaIdentityProviderConfig {
provider: "okta";
clientId:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
clientSecret:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
issuer:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}
export interface KeycloakIdentityProviderConfig {
provider: "keycloak";
clientId:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
clientSecret:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
issuer:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}
export interface MicrosoftEntraIDIdentityProviderConfig {
provider: "microsoft-entra-id";
clientId:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
clientSecret:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
issuer:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}
export interface GCPIAPIdentityProviderConfig {
provider: "gcp-iap";
audience:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}

File diff suppressed because it is too large Load diff

View file

@ -26,6 +26,14 @@ export type LanguageModel =
| OpenRouterLanguageModel | OpenRouterLanguageModel
| XaiLanguageModel; | XaiLanguageModel;
export type AppConfig = GitHubAppConfig; export type AppConfig = GitHubAppConfig;
export type IdentityProviderConfig =
| GitHubIdentityProviderConfig
| GitLabIdentityProviderConfig
| GoogleIdentityProviderConfig
| OktaIdentityProviderConfig
| KeycloakIdentityProviderConfig
| MicrosoftEntraIDIdentityProviderConfig
| GCPIAPIdentityProviderConfig;
export interface SourcebotConfig { export interface SourcebotConfig {
$schema?: string; $schema?: string;
@ -50,6 +58,10 @@ export interface SourcebotConfig {
* Defines a collection of apps that are available to Sourcebot. * Defines a collection of apps that are available to Sourcebot.
*/ */
apps?: AppConfig[]; apps?: AppConfig[];
/**
* Defines a collection of identity providers that are available to Sourcebot.
*/
identityProviders?: IdentityProviderConfig[];
} }
/** /**
* Defines the global settings for Sourcebot. * Defines the global settings for Sourcebot.
@ -1078,7 +1090,7 @@ export interface GitHubAppConfig {
/** /**
* GitHub App Configuration * GitHub App Configuration
*/ */
type: "githubApp"; type: "github";
/** /**
* The hostname of the GitHub App deployment. * The hostname of the GitHub App deployment.
*/ */
@ -1104,3 +1116,267 @@ export interface GitHubAppConfig {
env: string; env: string;
}; };
} }
export interface GitHubIdentityProviderConfig {
provider: "github";
purpose: "sso" | "identity";
clientId:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
clientSecret:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
baseUrl?:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}
export interface GitLabIdentityProviderConfig {
provider: "gitlab";
purpose: "sso" | "identity";
clientId:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
clientSecret:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
baseUrl:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}
export interface GoogleIdentityProviderConfig {
provider: "google";
clientId:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
clientSecret:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}
export interface OktaIdentityProviderConfig {
provider: "okta";
clientId:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
clientSecret:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
issuer:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}
export interface KeycloakIdentityProviderConfig {
provider: "keycloak";
clientId:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
clientSecret:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
issuer:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}
export interface MicrosoftEntraIDIdentityProviderConfig {
provider: "microsoft-entra-id";
clientId:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
clientSecret:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
issuer:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}
export interface GCPIAPIdentityProviderConfig {
provider: "gcp-iap";
audience:
| {
/**
* The name of the secret that contains the token.
*/
secret: string;
}
| {
/**
* The name of the environment variable that contains the token. Only supported in declarative connection configs.
*/
env: string;
};
[k: string]: unknown;
}

View file

@ -6,7 +6,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"type": { "type": {
"const": "githubApp", "const": "github",
"description": "GitHub App Configuration" "description": "GitHub App Configuration"
}, },
"deploymentHostname": { "deploymentHostname": {

View file

@ -0,0 +1,152 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "IdentityProviderConfig",
"definitions": {
"GitHubIdentityProviderConfig": {
"type": "object",
"properties": {
"provider": {
"const": "github"
},
"purpose": {
"enum": ["sso", "identity"]
},
"clientId": {
"$ref": "./shared.json#/definitions/Token"
},
"clientSecret": {
"$ref": "./shared.json#/definitions/Token"
},
"baseUrl": {
"$ref": "./shared.json#/definitions/Token"
}
},
"required": ["provider", "purpose", "clientId", "clientSecret"]
},
"GitLabIdentityProviderConfig": {
"type": "object",
"properties": {
"provider": {
"const": "gitlab"
},
"purpose": {
"enum": ["sso", "identity"]
},
"clientId": {
"$ref": "./shared.json#/definitions/Token"
},
"clientSecret": {
"$ref": "./shared.json#/definitions/Token"
},
"baseUrl": {
"$ref": "./shared.json#/definitions/Token"
}
},
"required": ["provider", "purpose", "clientId", "clientSecret", "baseUrl"]
},
"GoogleIdentityProviderConfig": {
"type": "object",
"properties": {
"provider": {
"const": "google"
},
"clientId": {
"$ref": "./shared.json#/definitions/Token"
},
"clientSecret": {
"$ref": "./shared.json#/definitions/Token"
}
},
"required": ["provider", "clientId", "clientSecret"]
},
"OktaIdentityProviderConfig": {
"type": "object",
"properties": {
"provider": {
"const": "okta"
},
"clientId": {
"$ref": "./shared.json#/definitions/Token"
},
"clientSecret": {
"$ref": "./shared.json#/definitions/Token"
},
"issuer": {
"$ref": "./shared.json#/definitions/Token"
}
},
"required": ["provider", "clientId", "clientSecret", "issuer"]
},
"KeycloakIdentityProviderConfig": {
"type": "object",
"properties": {
"provider": {
"const": "keycloak"
},
"clientId": {
"$ref": "./shared.json#/definitions/Token"
},
"clientSecret": {
"$ref": "./shared.json#/definitions/Token"
},
"issuer": {
"$ref": "./shared.json#/definitions/Token"
}
},
"required": ["provider", "clientId", "clientSecret", "issuer"]
},
"MicrosoftEntraIDIdentityProviderConfig": {
"type": "object",
"properties": {
"provider": {
"const": "microsoft-entra-id"
},
"clientId": {
"$ref": "./shared.json#/definitions/Token"
},
"clientSecret": {
"$ref": "./shared.json#/definitions/Token"
},
"issuer": {
"$ref": "./shared.json#/definitions/Token"
}
},
"required": ["provider", "clientId", "clientSecret", "issuer"]
},
"GCPIAPIdentityProviderConfig": {
"type": "object",
"properties": {
"provider": {
"const": "gcp-iap"
},
"audience": {
"$ref": "./shared.json#/definitions/Token"
}
},
"required": ["provider", "audience"]
}
},
"oneOf": [
{
"$ref": "#/definitions/GitHubIdentityProviderConfig"
},
{
"$ref": "#/definitions/GitLabIdentityProviderConfig"
},
{
"$ref": "#/definitions/GoogleIdentityProviderConfig"
},
{
"$ref": "#/definitions/OktaIdentityProviderConfig"
},
{
"$ref": "#/definitions/KeycloakIdentityProviderConfig"
},
{
"$ref": "#/definitions/MicrosoftEntraIDIdentityProviderConfig"
},
{
"$ref": "#/definitions/GCPIAPIdentityProviderConfig"
}
]
}

View file

@ -125,6 +125,13 @@
"items": { "items": {
"$ref": "./app.json" "$ref": "./app.json"
} }
},
"identityProviders": {
"type": "array",
"description": "Defines a collection of identity providers that are available to Sourcebot.",
"items": {
"$ref": "./authProvider.json"
}
} }
}, },
"additionalProperties": false "additionalProperties": false