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

fix: syncer tilgangsgrupper fra vtp til å få samme svar fra entra og msgraph api. #1393

Merged
merged 1 commit into from
Nov 20, 2024
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
@@ -1,6 +1,6 @@
saksbehandler=saksbehandler
beslutter=beslutter
overstyrer=overstyrer
oppgavestyrer=oppgavestyrer
veileder=veileder
drift=drift
saksbehandler=eb211c0d-9ca6-467f-8863-9def2cc06fd3
beslutter=803b1fd5-27a0-46a2-b1b3-7152f44128b4
overstyrer=503f0cae-5bcd-484b-949c-a7e92d712858
oppgavestyrer=d18989ec-5e07-494b-ad96-0c1f0c76de53
veileder=edfe14fe-9a34-4ecb-8840-536ac2bc2818
drift=89c71f0c-ca57-4e6f-8545-990f9e24c762
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class GroupsProviderTest {
@Test
void testGroupsForLocal() {
var provider = GroupsProvider.instance();
assertThat(provider.getGroupValue(Groups.BESLUTTER)).isEqualTo("beslutter");
assertThat(provider.getGroupFrom("drift")).isEqualTo(Groups.DRIFT);
var grupper = List.of("saksbehandler", "overstyrer");
assertThat(provider.getGroupValue(Groups.BESLUTTER)).isEqualTo("803b1fd5-27a0-46a2-b1b3-7152f44128b4");
assertThat(provider.getGroupFrom("89c71f0c-ca57-4e6f-8545-990f9e24c762")).isEqualTo(Groups.DRIFT);
var grupper = List.of("eb211c0d-9ca6-467f-8863-9def2cc06fd3", "503f0cae-5bcd-484b-949c-a7e92d712858");
assertThat(provider.getGroupsFrom(grupper)).containsAll(Set.of(Groups.SAKSBEHANDLER, Groups.OVERSTYRER));

assertThat(provider.getGroupFrom(null)).isNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void skal_ekstrahere_grupper_fra_aad_obo_med_navident_med_grupper() {
// that its client_id is the Claim Value

var ident = "minident";
var grupper = List.of("saksbehandler", "oppgavestyrer");
var grupper = List.of("eb211c0d-9ca6-467f-8863-9def2cc06fd3", "d18989ec-5e07-494b-ad96-0c1f0c76de53");
var oid = UUID.randomUUID();

var token = new OidcTokenGenerator()
Expand Down Expand Up @@ -223,7 +223,7 @@ void skal_ekstrahere_grupper_fra_aad_obo_med_navident_med_uglydig_gruppe() {
// that its client_id is the Claim Value

var ident = "minident";
List<String> grupper = List.of("saksbehandler", "angriper");
List<String> grupper = List.of("eb211c0d-9ca6-467f-8863-9def2cc06fd3", "angriper");

var token = new OidcTokenGenerator()
.withClaim(AzureProperty.NAV_IDENT, ident)
Expand Down