fix: make signing key configs secret
Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
This commit is contained in:
Vendored
+7
-4
@@ -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;
|
||||
}>;
|
||||
|
||||
@@ -269,7 +269,7 @@ export type BitbucketIntegrationConfig = {
|
||||
token?: string;
|
||||
username?: string;
|
||||
appPassword?: string;
|
||||
signingKey?: string;
|
||||
commitSigningKey?: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
|
||||
@@ -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
@@ -29,6 +29,7 @@ export interface Config {
|
||||
|
||||
/**
|
||||
* Default PGP signing key for signing commits.
|
||||
* @visibility secret
|
||||
*/
|
||||
defaultCommitSigningKey?: string;
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user