@@ -12,7 +12,7 @@ export type RawCredential = UnvalidatedObject<Credential>;
1212/** A schema for credential objects with a username. */
1313export const usernameSchema = {
1414 /** The username needed to authenticate to the package registry, if any. */
15- username : json . optionalOrNull ( json . string ) ,
15+ username : json . optional ( json . string ) ,
1616} as const satisfies json . Schema ;
1717
1818/** Usernames may be present for both authentication with tokens or passwords. */
@@ -29,7 +29,7 @@ export function hasUsername(config: AuthConfig): config is Username {
2929/** A schema for credential objects with a username and password. */
3030export const usernamePasswordSchema = {
3131 /** The password needed to authenticate to the package registry, if any. */
32- password : json . optionalOrNull ( json . string ) ,
32+ password : json . optional ( json . string ) ,
3333 ...usernameSchema ,
3434} as const satisfies json . Schema ;
3535
@@ -52,7 +52,7 @@ export function hasUsernameAndPassword(
5252/** A schema for credential objects for token-based authentication. */
5353export const tokenSchema = {
5454 /** The token needed to authenticate to the package registry, if any. */
55- token : json . optionalOrNull ( json . string ) ,
55+ token : json . optional ( json . string ) ,
5656 ...usernameSchema ,
5757} as const satisfies json . Schema ;
5858
@@ -100,7 +100,7 @@ export const awsConfigSchema = {
100100 "role-name" : json . string ,
101101 domain : json . string ,
102102 "domain-owner" : json . string ,
103- audience : json . optionalOrNull ( json . string ) ,
103+ audience : json . optional ( json . string ) ,
104104} as const satisfies json . Schema ;
105105
106106/** Configuration for AWS OIDC. */
@@ -116,8 +116,8 @@ export function isAWSConfig(
116116/** A schema for JFrog OIDC configurations. */
117117export const jfrogConfigSchema = {
118118 "jfrog-oidc-provider-name" : json . string ,
119- audience : json . optionalOrNull ( json . string ) ,
120- "identity-mapping-name" : json . optionalOrNull ( json . string ) ,
119+ audience : json . optional ( json . string ) ,
120+ "identity-mapping-name" : json . optional ( json . string ) ,
121121} as const satisfies json . Schema ;
122122
123123/** Configuration for JFrog OIDC. */
@@ -150,8 +150,8 @@ export function isCloudsmithConfig(
150150/** A schema for GCP OIDC configurations. */
151151export const gcpConfigSchema = {
152152 "workload-identity-provider" : json . string ,
153- "service-account" : json . optionalOrNull ( json . string ) ,
154- audience : json . optionalOrNull ( json . string ) ,
153+ "service-account" : json . optional ( json . string ) ,
154+ audience : json . optional ( json . string ) ,
155155} as const satisfies json . Schema ;
156156
157157/** Configuration for GCP OIDC. */
0 commit comments