File tree Expand file tree Collapse file tree 1 file changed +26
-6
lines changed
Expand file tree Collapse file tree 1 file changed +26
-6
lines changed Original file line number Diff line number Diff line change 55 */
66export type RawCredential = Partial < Credential > ;
77
8- /**
9- * A package registry configuration includes identifying information as well as
10- * authentication credentials.
11- */
12- export type Credential = {
8+ /** Usernames may be present for both authentication with tokens or passwords. */
9+ export type Username = {
1310 /** The username needed to authenticate to the package registry, if any. */
1411 username ?: string ;
12+ } ;
13+
14+ /**
15+ * Fields expected for authentication based on a username and password.
16+ * Both username and password are optional.
17+ */
18+ export type UsernamePassword = {
1519 /** The password needed to authenticate to the package registry, if any. */
1620 password ?: string ;
21+ } & Username ;
22+
23+ /**
24+ * Fields expected for token-based authentication.
25+ * Both username and token are optional.
26+ */
27+ export type Token = {
1728 /** The token needed to authenticate to the package registry, if any. */
1829 token ?: string ;
19- } & Registry ;
30+ } & Username ;
31+
32+ /** All authentication-related fields. */
33+ export type AuthConfig = UsernamePassword & Token ;
34+
35+ /**
36+ * A package registry configuration includes identifying information as well as
37+ * authentication credentials.
38+ */
39+ export type Credential = AuthConfig & Registry ;
2040
2141/** A package registry is identified by its type and address. */
2242export type Registry = {
You can’t perform that action at this time.
0 commit comments