mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-15 05:45:20 +00:00
remove non secret token options
This commit is contained in:
parent
5d7a77bd92
commit
63af99aa59
12 changed files with 147 additions and 330 deletions
|
|
@ -6,7 +6,7 @@ import { PrismaClient, Repo } from "@sourcebot/db";
|
||||||
import { decrypt } from "@sourcebot/crypto";
|
import { decrypt } from "@sourcebot/crypto";
|
||||||
import { Token } from "@sourcebot/schemas/v3/shared.type";
|
import { Token } from "@sourcebot/schemas/v3/shared.type";
|
||||||
|
|
||||||
export const measure = async <T>(cb : () => Promise<T>) => {
|
export const measure = async <T>(cb: () => Promise<T>) => {
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
const data = await cb();
|
const data = await cb();
|
||||||
const durationMs = Date.now() - start;
|
const durationMs = Date.now() - start;
|
||||||
|
|
@ -89,38 +89,26 @@ export const excludeReposByTopic = <T extends Repository>(repos: T[], excludedRe
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getTokenFromConfig = async (token: Token, orgId: number, db?: PrismaClient) => {
|
export const getTokenFromConfig = async (token: Token, orgId: number, db?: PrismaClient) => {
|
||||||
if (typeof token === 'string') {
|
if (!db) {
|
||||||
return token;
|
throw new Error(`Database connection required to retrieve secret`);
|
||||||
}
|
}
|
||||||
if ('env' in token) {
|
|
||||||
const tokenValue = process.env[token.env];
|
|
||||||
if (!tokenValue) {
|
|
||||||
throw new Error(`The environment variable '${token.env}' was referenced in the config but was not set.`);
|
|
||||||
}
|
|
||||||
return tokenValue;
|
|
||||||
} else if ('secret' in token) {
|
|
||||||
if (!db) {
|
|
||||||
throw new Error(`Database connection required to retrieve secret`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const secretKey = token.secret;
|
|
||||||
const secret = await db.secret.findUnique({
|
|
||||||
where: {
|
|
||||||
orgId_key: {
|
|
||||||
key: secretKey,
|
|
||||||
orgId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!secret) {
|
|
||||||
throw new Error(`Secret with key ${secretKey} not found for org ${orgId}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const decryptedSecret = decrypt(secret.iv, secret.encryptedValue);
|
const secretKey = token.secret;
|
||||||
return decryptedSecret;
|
const secret = await db.secret.findUnique({
|
||||||
|
where: {
|
||||||
|
orgId_key: {
|
||||||
|
key: secretKey,
|
||||||
|
orgId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!secret) {
|
||||||
|
throw new Error(`Secret with key ${secretKey} not found for org ${orgId}`);
|
||||||
}
|
}
|
||||||
throw new Error(`Invalid token configuration in config`);
|
|
||||||
|
const decryptedSecret = decrypt(secret.iv, secret.encryptedValue);
|
||||||
|
return decryptedSecret;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const isRemotePath = (path: string) => {
|
export const isRemotePath = (path: string) => {
|
||||||
|
|
@ -172,7 +160,7 @@ export const fetchWithRetry = async <T>(
|
||||||
maxAttempts: number = 3
|
maxAttempts: number = 3
|
||||||
): Promise<T> => {
|
): Promise<T> => {
|
||||||
let attempts = 0;
|
let attempts = 0;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
return await fetchFn();
|
return await fetchFn();
|
||||||
|
|
|
||||||
|
|
@ -20,37 +20,17 @@ const schema = {
|
||||||
"env": "ENV_VAR_CONTAINING_TOKEN"
|
"env": "ENV_VAR_CONTAINING_TOKEN"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"anyOf": [
|
"type": "object",
|
||||||
{
|
"properties": {
|
||||||
"type": "string"
|
"secret": {
|
||||||
},
|
"type": "string",
|
||||||
{
|
"description": "The name of the secret that contains the token."
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"env": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The name of the environment variable that contains the token."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"env"
|
|
||||||
],
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"secret": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The name of the secret that contains the token."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"secret"
|
|
||||||
],
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
}
|
||||||
]
|
},
|
||||||
|
"required": [
|
||||||
|
"secret"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
|
||||||
|
|
@ -13,23 +13,7 @@ export interface GithubConnectionConfig {
|
||||||
* GitHub Configuration
|
* GitHub Configuration
|
||||||
*/
|
*/
|
||||||
type: "github";
|
type: "github";
|
||||||
/**
|
token?: Token;
|
||||||
* A Personal Access Token (PAT).
|
|
||||||
*/
|
|
||||||
token?:
|
|
||||||
| string
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* The name of the environment variable that contains the token.
|
|
||||||
*/
|
|
||||||
env: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* The name of the secret that contains the token.
|
|
||||||
*/
|
|
||||||
secret: string;
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* The URL of the GitHub host. Defaults to https://github.com
|
* The URL of the GitHub host. Defaults to https://github.com
|
||||||
*/
|
*/
|
||||||
|
|
@ -85,6 +69,15 @@ export interface GithubConnectionConfig {
|
||||||
};
|
};
|
||||||
revisions?: GitRevisions;
|
revisions?: GitRevisions;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* A Personal Access Token (PAT).
|
||||||
|
*/
|
||||||
|
export interface Token {
|
||||||
|
/**
|
||||||
|
* The name of the secret that contains the token.
|
||||||
|
*/
|
||||||
|
secret: string;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed.
|
* The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed.
|
||||||
*/
|
*/
|
||||||
|
|
@ -103,23 +96,7 @@ export interface GitlabConnectionConfig {
|
||||||
* GitLab Configuration
|
* GitLab Configuration
|
||||||
*/
|
*/
|
||||||
type: "gitlab";
|
type: "gitlab";
|
||||||
/**
|
token?: Token1;
|
||||||
* An authentication token.
|
|
||||||
*/
|
|
||||||
token?:
|
|
||||||
| string
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* The name of the environment variable that contains the token.
|
|
||||||
*/
|
|
||||||
env: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* The name of the secret that contains the token.
|
|
||||||
*/
|
|
||||||
secret: string;
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* The URL of the GitLab host. Defaults to https://gitlab.com
|
* The URL of the GitLab host. Defaults to https://gitlab.com
|
||||||
*/
|
*/
|
||||||
|
|
@ -166,28 +143,21 @@ export interface GitlabConnectionConfig {
|
||||||
};
|
};
|
||||||
revisions?: GitRevisions;
|
revisions?: GitRevisions;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* An authentication token.
|
||||||
|
*/
|
||||||
|
export interface Token1 {
|
||||||
|
/**
|
||||||
|
* The name of the secret that contains the token.
|
||||||
|
*/
|
||||||
|
secret: string;
|
||||||
|
}
|
||||||
export interface GiteaConnectionConfig {
|
export interface GiteaConnectionConfig {
|
||||||
/**
|
/**
|
||||||
* Gitea Configuration
|
* Gitea Configuration
|
||||||
*/
|
*/
|
||||||
type: "gitea";
|
type: "gitea";
|
||||||
/**
|
token?: Token2;
|
||||||
* A Personal Access Token (PAT).
|
|
||||||
*/
|
|
||||||
token?:
|
|
||||||
| string
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* The name of the environment variable that contains the token.
|
|
||||||
*/
|
|
||||||
env: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* The name of the secret that contains the token.
|
|
||||||
*/
|
|
||||||
secret: string;
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* The URL of the Gitea host. Defaults to https://gitea.com
|
* The URL of the Gitea host. Defaults to https://gitea.com
|
||||||
*/
|
*/
|
||||||
|
|
@ -220,6 +190,15 @@ export interface GiteaConnectionConfig {
|
||||||
};
|
};
|
||||||
revisions?: GitRevisions;
|
revisions?: GitRevisions;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* A Personal Access Token (PAT).
|
||||||
|
*/
|
||||||
|
export interface Token2 {
|
||||||
|
/**
|
||||||
|
* The name of the secret that contains the token.
|
||||||
|
*/
|
||||||
|
secret: string;
|
||||||
|
}
|
||||||
export interface GerritConnectionConfig {
|
export interface GerritConnectionConfig {
|
||||||
/**
|
/**
|
||||||
* Gerrit Configuration
|
* Gerrit Configuration
|
||||||
|
|
|
||||||
|
|
@ -16,37 +16,17 @@ const schema = {
|
||||||
"env": "ENV_VAR_CONTAINING_TOKEN"
|
"env": "ENV_VAR_CONTAINING_TOKEN"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"anyOf": [
|
"type": "object",
|
||||||
{
|
"properties": {
|
||||||
"type": "string"
|
"secret": {
|
||||||
},
|
"type": "string",
|
||||||
{
|
"description": "The name of the secret that contains the token."
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"env": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The name of the environment variable that contains the token."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"env"
|
|
||||||
],
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"secret": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The name of the secret that contains the token."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"secret"
|
|
||||||
],
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
}
|
||||||
]
|
},
|
||||||
|
"required": [
|
||||||
|
"secret"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
|
||||||
|
|
@ -5,23 +5,7 @@ export interface GiteaConnectionConfig {
|
||||||
* Gitea Configuration
|
* Gitea Configuration
|
||||||
*/
|
*/
|
||||||
type: "gitea";
|
type: "gitea";
|
||||||
/**
|
token?: Token;
|
||||||
* A Personal Access Token (PAT).
|
|
||||||
*/
|
|
||||||
token?:
|
|
||||||
| string
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* The name of the environment variable that contains the token.
|
|
||||||
*/
|
|
||||||
env: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* The name of the secret that contains the token.
|
|
||||||
*/
|
|
||||||
secret: string;
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* The URL of the Gitea host. Defaults to https://gitea.com
|
* The URL of the Gitea host. Defaults to https://gitea.com
|
||||||
*/
|
*/
|
||||||
|
|
@ -54,6 +38,15 @@ export interface GiteaConnectionConfig {
|
||||||
};
|
};
|
||||||
revisions?: GitRevisions;
|
revisions?: GitRevisions;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* A Personal Access Token (PAT).
|
||||||
|
*/
|
||||||
|
export interface Token {
|
||||||
|
/**
|
||||||
|
* The name of the secret that contains the token.
|
||||||
|
*/
|
||||||
|
secret: string;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed.
|
* The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -16,37 +16,17 @@ const schema = {
|
||||||
"env": "ENV_VAR_CONTAINING_TOKEN"
|
"env": "ENV_VAR_CONTAINING_TOKEN"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"anyOf": [
|
"type": "object",
|
||||||
{
|
"properties": {
|
||||||
"type": "string"
|
"secret": {
|
||||||
},
|
"type": "string",
|
||||||
{
|
"description": "The name of the secret that contains the token."
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"env": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The name of the environment variable that contains the token."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"env"
|
|
||||||
],
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"secret": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The name of the secret that contains the token."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"secret"
|
|
||||||
],
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
}
|
||||||
]
|
},
|
||||||
|
"required": [
|
||||||
|
"secret"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
|
||||||
|
|
@ -5,23 +5,7 @@ export interface GithubConnectionConfig {
|
||||||
* GitHub Configuration
|
* GitHub Configuration
|
||||||
*/
|
*/
|
||||||
type: "github";
|
type: "github";
|
||||||
/**
|
token?: Token;
|
||||||
* A Personal Access Token (PAT).
|
|
||||||
*/
|
|
||||||
token?:
|
|
||||||
| string
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* The name of the environment variable that contains the token.
|
|
||||||
*/
|
|
||||||
env: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* The name of the secret that contains the token.
|
|
||||||
*/
|
|
||||||
secret: string;
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* The URL of the GitHub host. Defaults to https://github.com
|
* The URL of the GitHub host. Defaults to https://github.com
|
||||||
*/
|
*/
|
||||||
|
|
@ -77,6 +61,15 @@ export interface GithubConnectionConfig {
|
||||||
};
|
};
|
||||||
revisions?: GitRevisions;
|
revisions?: GitRevisions;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* A Personal Access Token (PAT).
|
||||||
|
*/
|
||||||
|
export interface Token {
|
||||||
|
/**
|
||||||
|
* The name of the secret that contains the token.
|
||||||
|
*/
|
||||||
|
secret: string;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed.
|
* The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -16,37 +16,17 @@ const schema = {
|
||||||
"env": "ENV_VAR_CONTAINING_TOKEN"
|
"env": "ENV_VAR_CONTAINING_TOKEN"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"anyOf": [
|
"type": "object",
|
||||||
{
|
"properties": {
|
||||||
"type": "string"
|
"secret": {
|
||||||
},
|
"type": "string",
|
||||||
{
|
"description": "The name of the secret that contains the token."
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"env": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The name of the environment variable that contains the token."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"env"
|
|
||||||
],
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"secret": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The name of the secret that contains the token."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"secret"
|
|
||||||
],
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
}
|
||||||
]
|
},
|
||||||
|
"required": [
|
||||||
|
"secret"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
|
||||||
|
|
@ -5,23 +5,7 @@ export interface GitlabConnectionConfig {
|
||||||
* GitLab Configuration
|
* GitLab Configuration
|
||||||
*/
|
*/
|
||||||
type: "gitlab";
|
type: "gitlab";
|
||||||
/**
|
token?: Token;
|
||||||
* An authentication token.
|
|
||||||
*/
|
|
||||||
token?:
|
|
||||||
| string
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* The name of the environment variable that contains the token.
|
|
||||||
*/
|
|
||||||
env: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* The name of the secret that contains the token.
|
|
||||||
*/
|
|
||||||
secret: string;
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* The URL of the GitLab host. Defaults to https://gitlab.com
|
* The URL of the GitLab host. Defaults to https://gitlab.com
|
||||||
*/
|
*/
|
||||||
|
|
@ -68,6 +52,15 @@ export interface GitlabConnectionConfig {
|
||||||
};
|
};
|
||||||
revisions?: GitRevisions;
|
revisions?: GitRevisions;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* An authentication token.
|
||||||
|
*/
|
||||||
|
export interface Token {
|
||||||
|
/**
|
||||||
|
* The name of the secret that contains the token.
|
||||||
|
*/
|
||||||
|
secret: string;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed.
|
* The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -4,37 +4,17 @@ const schema = {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"definitions": {
|
"definitions": {
|
||||||
"Token": {
|
"Token": {
|
||||||
"anyOf": [
|
"type": "object",
|
||||||
{
|
"properties": {
|
||||||
"type": "string"
|
"secret": {
|
||||||
},
|
"type": "string",
|
||||||
{
|
"description": "The name of the secret that contains the token."
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"env": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The name of the environment variable that contains the token."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"env"
|
|
||||||
],
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"secret": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The name of the secret that contains the token."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"secret"
|
|
||||||
],
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
}
|
||||||
]
|
},
|
||||||
|
"required": [
|
||||||
|
"secret"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"GitRevisions": {
|
"GitRevisions": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,17 @@
|
||||||
// THIS IS A AUTO-GENERATED FILE. DO NOT MODIFY MANUALLY!
|
// THIS IS A AUTO-GENERATED FILE. DO NOT MODIFY MANUALLY!
|
||||||
|
|
||||||
|
export interface Shared {
|
||||||
|
[k: string]: unknown;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Shared`'s JSON-Schema
|
* This interface was referenced by `Shared`'s JSON-Schema
|
||||||
* via the `definition` "Token".
|
* via the `definition` "Token".
|
||||||
*/
|
*/
|
||||||
export type Token =
|
export interface Token {
|
||||||
| string
|
/**
|
||||||
| {
|
* The name of the secret that contains the token.
|
||||||
/**
|
*/
|
||||||
* The name of the environment variable that contains the token.
|
secret: string;
|
||||||
*/
|
|
||||||
env: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* The name of the secret that contains the token.
|
|
||||||
*/
|
|
||||||
secret: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface Shared {
|
|
||||||
[k: string]: unknown;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed.
|
* The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed.
|
||||||
|
|
|
||||||
|
|
@ -3,37 +3,17 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"definitions": {
|
"definitions": {
|
||||||
"Token": {
|
"Token": {
|
||||||
"anyOf": [
|
"type": "object",
|
||||||
{
|
"properties": {
|
||||||
"type": "string"
|
"secret": {
|
||||||
},
|
"type": "string",
|
||||||
{
|
"description": "The name of the secret that contains the token."
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"env": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The name of the environment variable that contains the token."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"env"
|
|
||||||
],
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"secret": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The name of the secret that contains the token."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"secret"
|
|
||||||
],
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
}
|
||||||
]
|
},
|
||||||
|
"required": [
|
||||||
|
"secret"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"GitRevisions": {
|
"GitRevisions": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue