feat(secrets): add ability to fetch and view all secrets across projects and groups, include scopeName, and improve frontend merging/filtering
This commit is contained in:
@@ -72,7 +72,7 @@ export class GiteaProvider extends BaseProvider {
|
||||
value: string,
|
||||
): Promise<interfaces.data.ISecret> {
|
||||
await this.client.setRepoSecret(projectId, key, value);
|
||||
return { key, value: '***', protected: false, masked: true, scope: 'project', scopeId: projectId, connectionId: this.connectionId, environment: '*' };
|
||||
return { key, value: '***', protected: false, masked: true, scope: 'project', scopeId: projectId, scopeName: projectId, connectionId: this.connectionId, environment: '*' };
|
||||
}
|
||||
|
||||
async updateProjectSecret(
|
||||
@@ -100,7 +100,7 @@ export class GiteaProvider extends BaseProvider {
|
||||
value: string,
|
||||
): Promise<interfaces.data.ISecret> {
|
||||
await this.client.setOrgSecret(groupId, key, value);
|
||||
return { key, value: '***', protected: false, masked: true, scope: 'group', scopeId: groupId, connectionId: this.connectionId, environment: '*' };
|
||||
return { key, value: '***', protected: false, masked: true, scope: 'group', scopeId: groupId, scopeName: groupId, connectionId: this.connectionId, environment: '*' };
|
||||
}
|
||||
|
||||
async updateGroupSecret(
|
||||
@@ -175,7 +175,7 @@ export class GiteaProvider extends BaseProvider {
|
||||
};
|
||||
}
|
||||
|
||||
private mapSecret(s: plugins.giteaClient.IGiteaSecret, scope: 'project' | 'group', scopeId: string): interfaces.data.ISecret {
|
||||
private mapSecret(s: plugins.giteaClient.IGiteaSecret, scope: 'project' | 'group', scopeId: string, scopeName?: string): interfaces.data.ISecret {
|
||||
return {
|
||||
key: s.name || '',
|
||||
value: '***',
|
||||
@@ -183,6 +183,7 @@ export class GiteaProvider extends BaseProvider {
|
||||
masked: true,
|
||||
scope,
|
||||
scopeId,
|
||||
scopeName: scopeName || scopeId,
|
||||
connectionId: this.connectionId,
|
||||
environment: '*',
|
||||
};
|
||||
|
||||
@@ -149,6 +149,7 @@ export class GitLabProvider extends BaseProvider {
|
||||
v: plugins.gitlabClient.IGitLabVariable,
|
||||
scope: 'project' | 'group',
|
||||
scopeId: string,
|
||||
scopeName?: string,
|
||||
): interfaces.data.ISecret {
|
||||
return {
|
||||
key: v.key || '',
|
||||
@@ -157,6 +158,7 @@ export class GitLabProvider extends BaseProvider {
|
||||
masked: v.masked || false,
|
||||
scope,
|
||||
scopeId,
|
||||
scopeName: scopeName || scopeId,
|
||||
connectionId: this.connectionId,
|
||||
environment: v.environment_scope || '*',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user