mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 05:19:49 +00:00
feature: gitlab secret scanning
This commit is contained in:
@@ -26,7 +26,7 @@ export enum AppConnection {
|
||||
Heroku = "heroku",
|
||||
Render = "render",
|
||||
Flyio = "flyio",
|
||||
Gitlab = "gitlab",
|
||||
GitLab = "gitlab",
|
||||
Cloudflare = "cloudflare",
|
||||
Bitbucket = "bitbucket",
|
||||
Zabbix = "zabbix",
|
||||
|
||||
@@ -13,7 +13,7 @@ const gitlabConnectionKeys = {
|
||||
[...gitlabConnectionKeys.all, "groups", connectionId] as const
|
||||
};
|
||||
|
||||
export const useGitlabConnectionListProjects = (
|
||||
export const useGitLabConnectionListProjects = (
|
||||
connectionId: string,
|
||||
options?: Omit<
|
||||
UseQueryOptions<
|
||||
@@ -38,7 +38,7 @@ export const useGitlabConnectionListProjects = (
|
||||
});
|
||||
};
|
||||
|
||||
export const useGitlabConnectionListGroups = (
|
||||
export const useGitLabConnectionListGroups = (
|
||||
connectionId: string,
|
||||
options?: Omit<
|
||||
UseQueryOptions<
|
||||
|
||||
@@ -124,7 +124,7 @@ export type TFlyioConnectionOption = TAppConnectionOptionBase & {
|
||||
};
|
||||
|
||||
export type TGitlabConnectionOption = TAppConnectionOptionBase & {
|
||||
app: AppConnection.Gitlab;
|
||||
app: AppConnection.GitLab;
|
||||
oauthClientId?: string;
|
||||
};
|
||||
|
||||
@@ -223,7 +223,7 @@ export type TAppConnectionOptionMap = {
|
||||
[AppConnection.Heroku]: THerokuConnectionOption;
|
||||
[AppConnection.Render]: TRenderConnectionOption;
|
||||
[AppConnection.Flyio]: TFlyioConnectionOption;
|
||||
[AppConnection.Gitlab]: TGitlabConnectionOption;
|
||||
[AppConnection.GitLab]: TGitlabConnectionOption;
|
||||
[AppConnection.Cloudflare]: TCloudflareConnectionOption;
|
||||
[AppConnection.Bitbucket]: TBitbucketConnectionOption;
|
||||
[AppConnection.Zabbix]: TZabbixConnectionOption;
|
||||
|
||||
@@ -8,7 +8,7 @@ export enum GitLabConnectionMethod {
|
||||
OAuth = "oauth"
|
||||
}
|
||||
|
||||
export type TGitLabConnection = TRootAppConnection & { app: AppConnection.Gitlab } & (
|
||||
export type TGitLabConnection = TRootAppConnection & { app: AppConnection.GitLab } & (
|
||||
| {
|
||||
method: GitLabConnectionMethod.AccessToken;
|
||||
credentials: {
|
||||
|
||||
@@ -173,7 +173,7 @@ export type TAppConnectionMap = {
|
||||
[AppConnection.Heroku]: THerokuConnection;
|
||||
[AppConnection.Render]: TRenderConnection;
|
||||
[AppConnection.Flyio]: TFlyioConnection;
|
||||
[AppConnection.Gitlab]: TGitLabConnection;
|
||||
[AppConnection.GitLab]: TGitLabConnection;
|
||||
[AppConnection.Cloudflare]: TCloudflareConnection;
|
||||
[AppConnection.Bitbucket]: TBitbucketConnection;
|
||||
[AppConnection.Zabbix]: TZabbixConnection;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export enum SecretScanningDataSource {
|
||||
GitHub = "github",
|
||||
Bitbucket = "bitbucket"
|
||||
Bitbucket = "bitbucket",
|
||||
GitLab = "gitlab"
|
||||
}
|
||||
|
||||
export enum SecretScanningScanStatus {
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import { AppConnection } from "@app/hooks/api/appConnections/enums";
|
||||
|
||||
import { SecretScanningDataSource } from "../enums";
|
||||
import { TSecretScanningDataSourceBase } from "./shared";
|
||||
|
||||
export enum GitLabDataSourceScope {
|
||||
Project = "project",
|
||||
Group = "group"
|
||||
}
|
||||
|
||||
export type TGitLabDataSource = TSecretScanningDataSourceBase & {
|
||||
type: SecretScanningDataSource.GitLab;
|
||||
config:
|
||||
| {
|
||||
groupId: number;
|
||||
groupName?: string;
|
||||
includeProjects: string[];
|
||||
scope: GitLabDataSourceScope.Group;
|
||||
}
|
||||
| {
|
||||
projectName?: string;
|
||||
projectId: number;
|
||||
scope: GitLabDataSourceScope.Project;
|
||||
};
|
||||
};
|
||||
|
||||
export type TGitLabDataSourceOption = {
|
||||
name: string;
|
||||
type: SecretScanningDataSource.GitLab;
|
||||
connection: AppConnection.GitLab;
|
||||
};
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
TGitLabDataSource,
|
||||
TGitLabDataSourceOption
|
||||
} from "@app/hooks/api/secretScanningV2/types/gitlab-data-source";
|
||||
import { DiscriminativePick } from "@app/types";
|
||||
|
||||
import {
|
||||
@@ -11,7 +15,10 @@ import {
|
||||
import { TBitbucketDataSource, TBitbucketDataSourceOption } from "./bitbucket-data-source";
|
||||
import { TGitHubDataSource, TGitHubDataSourceOption } from "./github-data-source";
|
||||
|
||||
export type TSecretScanningDataSource = TGitHubDataSource | TBitbucketDataSource;
|
||||
export type TSecretScanningDataSource =
|
||||
| TGitHubDataSource
|
||||
| TBitbucketDataSource
|
||||
| TGitLabDataSource;
|
||||
|
||||
export type TSecretScanningDataSourceWithDetails = TSecretScanningDataSource & {
|
||||
lastScannedAt: string | null;
|
||||
@@ -24,7 +31,10 @@ export type TListSecretScanningDataSources = {
|
||||
dataSources: TSecretScanningDataSourceWithDetails[];
|
||||
};
|
||||
|
||||
export type TSecretScanningDataSourceOption = TGitHubDataSourceOption | TBitbucketDataSourceOption;
|
||||
export type TSecretScanningDataSourceOption =
|
||||
| TGitHubDataSourceOption
|
||||
| TBitbucketDataSourceOption
|
||||
| TGitLabDataSourceOption;
|
||||
|
||||
export type TListSecretScanningDataSourceOptions = {
|
||||
dataSourceOptions: TSecretScanningDataSourceOption[];
|
||||
|
||||
@@ -29,7 +29,7 @@ export type TGitLabSync = TRootSecretSync & {
|
||||
shouldHideSecrets?: boolean;
|
||||
};
|
||||
connection: {
|
||||
app: AppConnection.Gitlab;
|
||||
app: AppConnection.GitLab;
|
||||
name: string;
|
||||
id: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user