Add API Key auth and improve endpoints

This commit is contained in:
Daniel 2021-01-19 15:37:55 +01:00
parent 8c6cb758f7
commit 11e8271d41
10 changed files with 529 additions and 164 deletions

View file

@ -77,7 +77,7 @@ func TestPermissions(t *testing.T) { //nolint:gocognit
PermitUser,
PermitAdmin,
PermitSelf,
Require,
Dynamic,
NotFound,
100, // Test a too high value.
-100, // Test a too low value.
@ -117,7 +117,7 @@ func TestPermissions(t *testing.T) { //nolint:gocognit
case handlerPerm == PermitAnyone:
// This is fast-tracked. There are not additional checks.
expectSuccess = true
case handlerPerm == Require:
case handlerPerm == Dynamic:
// This is turned into PermitAnyone in the authenticator.
// But authentication is still processed and the result still gets
// sanity checked!