Skip to content

Commit 98df528

Browse files
author
Vladimir Kotal
committed
add test with SUFFICIENT + OPTIONAL plugins
1 parent 4f5d5bd commit 98df528

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

opengrok-indexer/src/test/java/org/opengrok/indexer/authorization/AuthorizationFrameworkTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,21 @@ public static StackSetup[][] params() {
720720
NewTest(true, createAllowedProject()),
721721
NewTest(true, createAllowedGroup()))
722722
},
723+
{
724+
new StackSetup(
725+
NewStack(AuthControlFlag.REQUIRED,
726+
new AuthorizationPlugin(AuthControlFlag.OPTIONAL, createAllowedPrefixPlugin()),
727+
new AuthorizationPlugin(AuthControlFlag.SUFFICIENT, createNotAllowedPrefixPlugin())
728+
),
729+
// optional plugin returns false
730+
// sufficient plugin returns true => true
731+
NewTest(true, createUnallowedProject()),
732+
NewTest(true, createUnallowedGroup()),
733+
// optional plugin returns true
734+
// sufficient plugin returns false => true
735+
NewTest(true, createAllowedProject()),
736+
NewTest(true, createAllowedGroup()))
737+
},
723738
};
724739
}
725740

0 commit comments

Comments
 (0)