///
export interface BearerAccessToken {
token: string;
validUntil: Date;
}
export interface RemoteAuthenticationBasic {
type: "basic";
username: string;
password: string;
}
export interface RemoteAuthenticationBearer {
type: "oauth2";
username: string;
password: string;
fallbackValidity?: number;
forceScope?: string;
clientId?: string;
}
export declare type RemoteAuthentication = RemoteAuthenticationBasic | RemoteAuthenticationBearer;
export declare type AuthenticationScope = null | undefined | string[];
export interface LocalAuthenticationBasic {
type: "basic";
authenticate: (username: string, password: string) => Promise;
}
export interface LocalAuthenticationOAuth {
type: "oauth";
jwtSecret: string | Buffer;
service: string;
tokenLifetime: number;
useHttps?: boolean;
authenticate: (username: string, password: string) => Promise;
resolveRepositories: (username: string) => Promise;
}
export interface LocalAuthenticationNone {
type: "none";
scope: AuthenticationScope;
}
export declare type LocalAuthentication = LocalAuthenticationBasic | LocalAuthenticationNone | LocalAuthenticationOAuth;
export interface ProxyConfig {
realm: string;
remoteRegistryUrl: string;
remoteAuthentication?: RemoteAuthentication;
localAuthentication: LocalAuthentication;
}