fix: make signing key configs secret

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
This commit is contained in:
Hellgren Heikki
2025-02-12 10:49:31 +02:00
parent 4f8b5b66a1
commit 4f026fc038
6 changed files with 14 additions and 10 deletions
+7 -4
View File
@@ -64,6 +64,7 @@ export interface Config {
}[];
/**
* PGP signing key for signing commits.
* @visibility secret
*/
commitSigningKey?: string;
}>;
@@ -100,6 +101,7 @@ export interface Config {
appPassword?: string;
/**
* PGP signing key for signing commits.
* @visibility secret
*/
commitSigningKey?: string;
}>;
@@ -118,6 +120,7 @@ export interface Config {
appPassword: string;
/**
* PGP signing key for signing commits.
* @visibility secret
*/
commitSigningKey?: string;
}>;
@@ -151,6 +154,7 @@ export interface Config {
apiBaseUrl?: string;
/**
* PGP signing key for signing commits.
* @visibility secret
*/
commitSigningKey?: string;
}>;
@@ -190,6 +194,7 @@ export interface Config {
password?: string;
/**
* PGP signing key for signing commits.
* @visibility secret
*/
commitSigningKey?: string;
}>;
@@ -253,10 +258,6 @@ export interface Config {
*/
allowedInstallationOwners?: string[];
}>;
/**
* PGP signing key for signing commits.
*/
commitSigningKey?: string;
}>;
/** Integration configuration for GitLab */
@@ -295,6 +296,7 @@ export interface Config {
baseUrl?: string;
/**
* PGP signing key for signing commits.
* @visibility secret
*/
commitSigningKey?: string;
}>;
@@ -379,6 +381,7 @@ export interface Config {
password?: string;
/**
* PGP signing key for signing commits.
* @visibility secret
*/
commitSigningKey?: string;
}>;
+1 -1
View File
@@ -269,7 +269,7 @@ export type BitbucketIntegrationConfig = {
token?: string;
username?: string;
appPassword?: string;
signingKey?: string;
commitSigningKey?: string;
};
// @public
+2 -2
View File
@@ -66,7 +66,7 @@ export type BitbucketIntegrationConfig = {
/**
* Signing key for commits
*/
signingKey?: string;
commitSigningKey?: string;
};
/**
@@ -105,7 +105,7 @@ export function readBitbucketIntegrationConfig(
token,
username,
appPassword,
signingKey: config.getOptionalString('signingKey'),
commitSigningKey: config.getOptionalString('commitSigningKey'),
};
}
@@ -388,8 +388,8 @@ export function createPublishBitbucketAction(options: {
: config.getOptionalString('scaffolder.defaultAuthor.email'),
};
const signingKey =
integrationConfig.config.signingKey ??
config.getOptionalString('scaffolder.defaultSigningKey');
integrationConfig.config.commitSigningKey ??
config.getOptionalString('scaffolder.defaultCommitSigningKey');
if (signCommit && !signingKey) {
throw new Error(
'Signing commits is enabled but no signing key is provided in the configuration',
@@ -74,7 +74,7 @@ describe('publish:gitlab', () => {
host: 'gitlab.com',
token: 'tokenlols',
apiBaseUrl: 'https://api.gitlab.com',
signingKey: 'test-signing-key',
commitSigningKey: 'test-signing-key',
},
{
host: 'hosted.gitlab.com',
+1
View File
@@ -29,6 +29,7 @@ export interface Config {
/**
* Default PGP signing key for signing commits.
* @visibility secret
*/
defaultCommitSigningKey?: string;
/**