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

chore(auth-api-lib): Cleanup legal repr. and general mandate feature flags. #17372

Merged
merged 1 commit into from
Jan 24, 2025
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 @@ -178,21 +178,13 @@ export class DelegationsIncomingService {

// If procuration holder is enabled, we need to get the general mandate delegations
if (types?.includes(AuthDelegationType.ProcurationHolder)) {
const isGeneralMandateDelegationEnabled =
await this.featureFlagService.getValue(
Features.isGeneralMandateDelegationEnabled,
false,
delegationPromises.push(
this.delegationsIncomingCustomService.findCompanyGeneralMandate(
user,
)
if (isGeneralMandateDelegationEnabled) {
delegationPromises.push(
this.delegationsIncomingCustomService.findCompanyGeneralMandate(
user,
clientAllowedApiScopes,
client.requireApiScopes,
),
)
}
clientAllowedApiScopes,
client.requireApiScopes,
),
)
}

if (providers.includes(AuthDelegationProvider.CompanyRegistry)) {
Expand Down Expand Up @@ -220,21 +212,13 @@ export class DelegationsIncomingService {
}

if (types?.includes(AuthDelegationType.GeneralMandate)) {
const isGeneralMandateDelegationEnabled =
await this.featureFlagService.getValue(
Features.isGeneralMandateDelegationEnabled,
false,
delegationPromises.push(
this.delegationsIncomingCustomService.findAllAvailableGeneralMandate(
user,
)
if (isGeneralMandateDelegationEnabled) {
delegationPromises.push(
this.delegationsIncomingCustomService.findAllAvailableGeneralMandate(
user,
clientAllowedApiScopes,
client.requireApiScopes,
),
)
}
clientAllowedApiScopes,
client.requireApiScopes,
),
)
}

if (
Expand All @@ -260,22 +244,14 @@ export class DelegationsIncomingService {
if (
providers.includes(AuthDelegationProvider.DistrictCommissionersRegistry)
) {
const isLegalRepresentativeDelegationEnabled =
await this.featureFlagService.getValue(
Features.isLegalRepresentativeDelegationEnabled,
false,
delegationPromises.push(
this.getAvailableDistrictCommissionersRegistryDelegations(
user,
)
if (isLegalRepresentativeDelegationEnabled) {
delegationPromises.push(
this.getAvailableDistrictCommissionersRegistryDelegations(
user,
types,
clientAllowedApiScopes,
client.requireApiScopes,
),
)
}
types,
clientAllowedApiScopes,
client.requireApiScopes,
),
)
}

const delegationSets = await Promise.all(delegationPromises)
Expand Down
6 changes: 0 additions & 6 deletions libs/feature-flags/src/lib/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@ export enum Features {
isPasskeyRegistrationEnabled = 'isPasskeyRegistrationEnabled',
isPasskeyAuthEnabled = 'isPasskeyAuthEnabled',

// Legal represantative delegation type
isLegalRepresentativeDelegationEnabled = 'isLegalRepresentativeDelegationEnabled',

// General mandate delegation type
isGeneralMandateDelegationEnabled = 'isGeneralMandateDelegationEnabled',

// Should auth api use national registry v3 for checking deceased status
isNationalRegistryV3DeceasedStatusEnabled = 'isNationalRegistryV3DeceasedStatusEnabled',
}
Expand Down
Loading