mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 11:26:17 +00:00
add secretGroup attribute to model definition
This commit is contained in:
@@ -61,15 +61,13 @@ const syncSecrets = async ({
|
|||||||
integrationAuth,
|
integrationAuth,
|
||||||
secrets,
|
secrets,
|
||||||
accessId,
|
accessId,
|
||||||
accessToken,
|
accessToken
|
||||||
secretGroupID
|
|
||||||
}: {
|
}: {
|
||||||
integration: IIntegration;
|
integration: IIntegration;
|
||||||
integrationAuth: IIntegrationAuth;
|
integrationAuth: IIntegrationAuth;
|
||||||
secrets: any;
|
secrets: any;
|
||||||
accessId: string | null;
|
accessId: string | null;
|
||||||
accessToken: string;
|
accessToken: string;
|
||||||
secretGroupID?: string;
|
|
||||||
}) => {
|
}) => {
|
||||||
switch (integration.integration) {
|
switch (integration.integration) {
|
||||||
case INTEGRATION_AZURE_KEY_VAULT:
|
case INTEGRATION_AZURE_KEY_VAULT:
|
||||||
@@ -210,8 +208,7 @@ const syncSecrets = async ({
|
|||||||
await syncSecretsNorthflank({
|
await syncSecretsNorthflank({
|
||||||
integration,
|
integration,
|
||||||
secrets,
|
secrets,
|
||||||
accessToken,
|
accessToken
|
||||||
secretGroupID
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1957,13 +1954,11 @@ const syncSecretsCloudflarePages = async ({
|
|||||||
const syncSecretsNorthflank = async ({
|
const syncSecretsNorthflank = async ({
|
||||||
integration,
|
integration,
|
||||||
secrets,
|
secrets,
|
||||||
accessToken,
|
accessToken
|
||||||
secretGroupID
|
|
||||||
}: {
|
}: {
|
||||||
integration: IIntegration;
|
integration: IIntegration;
|
||||||
secrets: any;
|
secrets: any;
|
||||||
accessToken: string;
|
accessToken: string;
|
||||||
secretGroupID?: string;
|
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
const modifiedFormatForSecretInjection = {
|
const modifiedFormatForSecretInjection = {
|
||||||
@@ -1973,7 +1968,7 @@ const syncSecretsNorthflank = async ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
await standardRequest.post(
|
await standardRequest.post(
|
||||||
`${INTEGRATION_NORTHFLANK_API_URL}/v1/projects/${integration.appId}/secrets/${secretGroupID}`,
|
`${INTEGRATION_NORTHFLANK_API_URL}/v1/projects/${integration.appId}/secrets/${integration.secretGroup}`,
|
||||||
modifiedFormatForSecretInjection,
|
modifiedFormatForSecretInjection,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ export interface IIntegration {
|
|||||||
path: string;
|
path: string;
|
||||||
region: string;
|
region: string;
|
||||||
secretPath: string;
|
secretPath: string;
|
||||||
|
secretGroup: string;
|
||||||
integration:
|
integration:
|
||||||
| "azure-key-vault"
|
| "azure-key-vault"
|
||||||
| "aws-parameter-store"
|
| "aws-parameter-store"
|
||||||
@@ -160,6 +161,10 @@ const integrationSchema = new Schema<IIntegration>(
|
|||||||
required: true,
|
required: true,
|
||||||
default: "/",
|
default: "/",
|
||||||
},
|
},
|
||||||
|
secretGroup: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
timestamps: true,
|
timestamps: true,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ interface Props {
|
|||||||
integrationAuthId: string;
|
integrationAuthId: string;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
secretPath: string;
|
secretPath: string;
|
||||||
|
secretGroup: string;
|
||||||
app: string | null;
|
app: string | null;
|
||||||
appId: string | null;
|
appId: string | null;
|
||||||
sourceEnvironment: string;
|
sourceEnvironment: string;
|
||||||
@@ -34,7 +35,8 @@ const createIntegration = ({
|
|||||||
owner,
|
owner,
|
||||||
path,
|
path,
|
||||||
region,
|
region,
|
||||||
secretPath
|
secretPath,
|
||||||
|
secretGroup
|
||||||
}: Props) =>
|
}: Props) =>
|
||||||
SecurityClient.fetchCall("/api/v1/integration", {
|
SecurityClient.fetchCall("/api/v1/integration", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@@ -54,7 +56,8 @@ const createIntegration = ({
|
|||||||
owner,
|
owner,
|
||||||
path,
|
path,
|
||||||
region,
|
region,
|
||||||
secretPath
|
secretPath,
|
||||||
|
secretGroup
|
||||||
})
|
})
|
||||||
}).then(async (res) => {
|
}).then(async (res) => {
|
||||||
if (res && res.status === 200) {
|
if (res && res.status === 200) {
|
||||||
|
|||||||
@@ -86,7 +86,8 @@ export default function NorthflankCreateIntegrationPage() {
|
|||||||
owner: null,
|
owner: null,
|
||||||
path: null,
|
path: null,
|
||||||
region: null,
|
region: null,
|
||||||
secretPath
|
secretPath,
|
||||||
|
secretGroup: targetSecretGroup
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user