Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TypeScript service default values to match Java #241

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,8 @@ export function usernameProviderFactory(provider?: any, type?: UserAttributeType
if (type === UserAttributeType.ANONYMOUS || (!type && AnonymousRegisteredServiceUsernameProvider.instanceOf(provider))) {
return new AnonymousRegisteredServiceUsernameProvider(provider);
}
if (!type && !provider) {
return new DefaultRegisteredServiceUsernameProvider();
}
return provider;
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class ReturnAllowedAttributeReleasePolicy extends AbstractRegisteredServi
super(policy);
const p: ReturnAllowedAttributeReleasePolicy = ReturnAllowedAttributeReleasePolicy.instanceOf(policy)
? policy as ReturnAllowedAttributeReleasePolicy : undefined;
this.allowedAttributes = p?.allowedAttributes;
this.allowedAttributes = p?.allowedAttributes ?? [];
this['@class'] = ReturnAllowedAttributeReleasePolicy.cName;
}
}
Expand Down Expand Up @@ -488,7 +488,7 @@ export function attributeReleaseFactory(policy?: any, type?: ReleasePolicyType):
return new ChainingAttributeReleasePolicy(policy);
}
if (!type && !policy) {
return new DenyAllAttributeReleasePolicy();
return new ReturnAllowedAttributeReleasePolicy();
}
return policy;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class DefaultRegisteredServiceMultifactorPolicy extends RegisteredService
const p: DefaultRegisteredServiceMultifactorPolicy = DefaultRegisteredServiceMultifactorPolicy.instanceOf(policy)
? policy as DefaultRegisteredServiceMultifactorPolicy : undefined;
this.multifactorAuthenticationProviders = p?.multifactorAuthenticationProviders;
this.failureMode = p?.failureMode;
this.failureMode = p?.failureMode ?? 'UNDEFINED';
this.principalAttributeNameTrigger = p?.principalAttributeNameTrigger;
this.principalAttributeValueToMatch = p?.principalAttributeValueToMatch;
this.bypassEnabled = p?.bypassEnabled ?? false;
Expand Down Expand Up @@ -88,5 +88,8 @@ export function mfaPolicyFactory(policy?: any, type?: MfaPolicyType): Registered
if (type === MfaPolicyType.GROOVY || (!type && GroovyRegisteredServiceMultifactorPolicy.instanceOf(policy))) {
return new GroovyRegisteredServiceMultifactorPolicy(policy);
}
if (!type && !policy) {
return new DefaultRegisteredServiceMultifactorPolicy();
}
return policy;
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export class OAuthRegisteredService extends RegexRegisteredService {
this.clientId = s?.clientId;
this.bypassApprovalPrompt = s?.bypassApprovalPrompt ?? false;
this.generateRefreshToken = s?.generateRefreshToken ?? false;
this.supportedGrantTypes = s?.supportedGrantTypes;
this.supportedResponseTypes = s?.supportedResponseTypes;
this.supportedGrantTypes = s?.supportedGrantTypes ?? [];
this.supportedResponseTypes = s?.supportedResponseTypes ?? [];
this.jwtAccessToken = s?.jwtAccessToken ?? false;
this.codeExpirationPolicy = codeExpirationPolicy(s?.codeExpirationPolicy);
this.accessTokenExpirationPolicy = accessTokenExpirationPolicy(s?.accessTokenExpirationPolicy);
Expand Down Expand Up @@ -112,7 +112,7 @@ export class OidcRegisteredService extends OAuthRegisteredService {
this.userInfoEncryptedResponseEncoding = s?.userInfoEncryptedResponseEncoding;
this.dynamicallyRegistered = s?.dynamicallyRegistered ?? false;
this.dynamicRegistrationDateTime = s?.dynamicRegistrationDateTime;
this.scopes = s?.scopes;
this.scopes = s?.scopes ?? [];
this.subjectType = s?.subjectType ?? 'PUBLIC';
this.sectorIdentifierUri = s?.sectorIdentifierUri;
this.applicationType = s?.applicationType ?? 'web';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export abstract class RegisteredService {
this.logoutType = service?.logoutType ?? 'BACK_CHANNEL';
this.accessStrategy = accessStrategyFactory(service?.accessStrategy);
this.publicKey = service?.publicKey;
this.properties = service?.properties;
this.properties = service?.properties ?? new Map<string, DefaultRegisteredServiceProperty>();
this.contacts = contactsFactory(service?.contacts);
this.expirationPolicy = expirationPolicyFactory(service?.expirationPolicy);
this.environments = service?.environments;
Expand Down