fix(secretmanagement): Refactor secret bundle actions and improve authorization handling

This commit is contained in:
2024-12-28 19:50:29 +01:00
parent e19d0b4deb
commit dbd9b661c6
9 changed files with 99 additions and 57 deletions

View File

@ -1,6 +0,0 @@
export interface IEnvBundle {
environment: string;
timeSensitive: boolean;
configKeyValueObject: {[key: string]: string};
}

View File

@ -3,7 +3,6 @@ export * from './cluster.js';
export * from './config.js';
export * from './deployment.js';
export * from './docker.js';
export * from './env.js';
export * from './event.js';
export * from './image.js';
export * from './secretbundle.js';

View File

@ -45,9 +45,11 @@ export interface ISecretBundle {
/**
* authrozations select a specific environment of a config bundle
*/
authorizations: Array<{
secretAccessKey: string;
environment: string;
}>;
authorizations: Array<ISecretBundleAuthorization>;
};
}
export interface ISecretBundleAuthorization {
secretAccessKey: string;
environment: string;
}

View File

@ -2,26 +2,6 @@ import * as plugins from '../plugins.js';
import * as data from '../data/index.js';
import * as userInterfaces from '../data/user.js';
/**
* when retrieving secrets for actual use, you do this in the form of an envBundle.
*/
export interface IReq_GetEnvBundle extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_GetEnvBundle
> {
method: 'getEnvBundle';
request: {
authorization: string;
/**
* specify this if you want to get a warning, if the envBundle is for an unexpected environment
*/
environment?: string;
};
response: {
envBundle: data.IEnvBundle;
};
}
export interface IReq_GetSecretBundles extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_GetSecretBundles
@ -92,3 +72,32 @@ export interface IReq_DeleteSecretBundleById extends plugins.typedrequestInterfa
ok: boolean;
};
}
export interface IReq_GetSecretBundleByAuthorization extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_GetSecretBundleByAuthorization
> {
method: 'getSecretBundleByAuthorization';
request: {
identity: userInterfaces.IIdentity;
secretBundleAuthorization: data.ISecretBundleAuthorization;
};
response: {
secretBundle: data.ISecretBundle;
};
}
export interface IReq_GetFlatKeyValueObject extends plugins.typedrequestInterfaces.implementsTR<
plugins.typedrequestInterfaces.ITypedRequest,
IReq_GetFlatKeyValueObject
> {
method: 'getFlatKeyValueObject';
request: {
identity: userInterfaces.IIdentity;
seccretBundleId: string;
secretBundleAuthorization: data.ISecretBundleAuthorization;
};
response: {
flatKeyValueObject: {[key: string]: string};
};
}