Make options to getCredentials required
Signed-off-by: Marcus Eide <eide@spotify.com>
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -26,5 +26,5 @@ export type GitlabCredentials = {
|
||||
* @public
|
||||
*/
|
||||
export interface GitlabCredentialsProvider {
|
||||
getCredentials(opts?: { url: string }): Promise<GitlabCredentials>;
|
||||
getCredentials(opts: { url: string }): Promise<GitlabCredentials>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user