-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix basic authentication -> rm authz.*
- Loading branch information
1 parent
534db0d
commit 0b3c0e5
Showing
8 changed files
with
110 additions
and
75 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,4 +1,91 @@ | ||
package {{ lcfirst ( camelcase .ModuleName ) }}.authz | ||
|
||
default allowEntrypoint = true | ||
default allowAccess = true | ||
# | ||
# Methods | ||
# | ||
|
||
default getMethod = false | ||
|
||
getMethod { | ||
lower(input.method) == "get" | ||
} | ||
|
||
default putMethod = false | ||
|
||
putMethod { | ||
lower(input.method) == "put" | ||
} | ||
|
||
default postMethod = false | ||
|
||
postMethod { | ||
lower(input.method) == "post" | ||
} | ||
|
||
default deleteMethod = false | ||
|
||
deleteMethod { | ||
lower(input.method) == "delete" | ||
} | ||
|
||
# | ||
# Roles | ||
# | ||
|
||
default staff = false | ||
|
||
staff { | ||
lower(input.role) == "staff" | ||
} | ||
|
||
default user = false | ||
|
||
user { | ||
lower(input.role) == "user" | ||
} | ||
|
||
default staffuser = false | ||
|
||
staffuser { | ||
staff | ||
} | ||
|
||
staffuser { | ||
user | ||
} | ||
|
||
# | ||
# API token | ||
# | ||
|
||
default api = false | ||
|
||
api { | ||
lower(input.role) == "api" | ||
} | ||
|
||
api { | ||
input.apitoken == "" | ||
} | ||
|
||
# | ||
# Rules | ||
# | ||
# allowEntryPoint permit general the access to a api function | ||
# allowAccess check the authorization by the permitted roles | ||
# | ||
default allowEntrypoint = false | ||
|
||
default allowAccess = false | ||
|
||
allowEntrypoint { | ||
# user | ||
# getMethod | ||
# input.path == "/livez" | ||
} | ||
|
||
allowAccess { | ||
# user | ||
# getMethod | ||
# input.path == "/livez" | ||
} |
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