mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
Implement "Commits.signature" method (#1386)
This commit is contained in:
parent
8605ec48b9
commit
28fc40a241
@ -54,6 +54,43 @@ export interface CommitAction {
|
||||
lastCommitId?: string;
|
||||
}
|
||||
|
||||
export interface GPGSignature {
|
||||
signature_type: "PGP",
|
||||
verification_status: "verified"|"unverified";
|
||||
gpg_key_id: number;
|
||||
gpg_key_primary_keyid: string;
|
||||
gpg_key_user_name: string;
|
||||
gpg_key_user_email: string;
|
||||
gpg_key_subkey_id: number | null;
|
||||
commit_source: string;
|
||||
}
|
||||
|
||||
export interface X509Signature {
|
||||
signature_type: "X509";
|
||||
verification_status: "verified"|"unverified",
|
||||
x509_certificate: {
|
||||
id: number;
|
||||
subject: string;
|
||||
subject_key_identifier: string;
|
||||
email: string;
|
||||
serial_number: string;
|
||||
certificate_status: string;
|
||||
x509_issuer: {
|
||||
id: number;
|
||||
subject: string;
|
||||
subject_key_identifier: string;
|
||||
crl_url: string;
|
||||
};
|
||||
};
|
||||
commit_source: string;
|
||||
}
|
||||
|
||||
export interface MissingSignature {
|
||||
message: string;
|
||||
}
|
||||
|
||||
export type CommitSignature = GPGSignature | X509Signature | MissingSignature;
|
||||
|
||||
export class Commits extends BaseService {
|
||||
all(projectId: string | number, options?: PaginatedRequestOptions) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
@ -152,4 +189,14 @@ export class Commits extends BaseService {
|
||||
options,
|
||||
);
|
||||
}
|
||||
|
||||
signature(projectId: string | number, sha: string, options?: BaseRequestOptions): Promise<CommitSignature> {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(
|
||||
this,
|
||||
`projects/${pId}/repository/commits/${sha}/signature`,
|
||||
options,
|
||||
) as Promise<CommitSignature>;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user