Skip to content

Commit

Permalink
fix: syncer tilgangsgrupper fra vtp til å få samme svar fra entra og …
Browse files Browse the repository at this point in the history
…msgraph api.
  • Loading branch information
mrsladek committed Nov 20, 2024
1 parent 598fd92 commit 31a52bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
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

0 comments on commit 31a52bf

Please sign in to comment.