Make options to getCredentials required

Signed-off-by: Marcus Eide <eide@spotify.com>
This commit is contained in:
Marcus Eide
2023-05-16 09:47:42 +02:00
parent a52fd3452b
commit 7aec28347c
3 changed files with 10 additions and 6 deletions
+1 -1
View File
@@ -501,7 +501,7 @@ export type GitlabCredentials = {
// @public (undocumented)
export interface GitlabCredentialsProvider {
// (undocumented)
getCredentials(opts?: { url: string }): Promise<GitlabCredentials>;
getCredentials(opts: { url: string }): Promise<GitlabCredentials>;
}
// @public
@@ -28,11 +28,15 @@ export class SingleInstanceGitlabCredentialsProvider
constructor(private readonly token?: string) {}
async getCredentials(): Promise<GitlabCredentials> {
async getCredentials(_opts: { url: string }): Promise<GitlabCredentials> {
if (!this.token) {
return {};
}
return {
headers: this.token
? { Authorization: `Bearer ${this.token}` }
: undefined,
headers: {
Authorization: `Bearer ${this.token}`,
},
token: this.token,
};
}
+1 -1
View File
@@ -26,5 +26,5 @@ export type GitlabCredentials = {
* @public
*/
export interface GitlabCredentialsProvider {
getCredentials(opts?: { url: string }): Promise<GitlabCredentials>;
getCredentials(opts: { url: string }): Promise<GitlabCredentials>;
}