-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(auth-delegations): Fix missing domains for legal representative d…
…elegations (#17304) * attempt to fix delegation bugs * add filterOutForDelegationType to utils func * Utils func changes --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
95f602a
commit 9364323
Showing
5 changed files
with
67 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
libs/auth-api-lib/src/lib/delegations/utils/filterByScopeCustomScopeRule.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { AuthDelegationType } from '@island.is/shared/types' | ||
import { ApiScopeInfo } from '../delegations-incoming.service' | ||
|
||
export default function filterByCustomScopeRule( | ||
scope: ApiScopeInfo, | ||
filterOutForDelegationType: AuthDelegationType[], | ||
customScopeRules: { | ||
scopeName: string | ||
onlyForDelegationType: string[] | ||
}[], | ||
): boolean { | ||
const foundCSR = customScopeRules.find((csr) => csr.scopeName === scope.name) | ||
|
||
if (!foundCSR) { | ||
return true | ||
} | ||
|
||
return foundCSR.onlyForDelegationType.some((type) => | ||
filterOutForDelegationType.includes(type as AuthDelegationType), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters