feat(auth): add argon2id passwords, sessions, rate limiter, authorization and audit builders
- feat(auth): add argon2id passwords, sessions, rate limiter, authorization and audit builders - feat(cli): add check and audit commands - feat(api): add api framework, login, page routes and account, user, delegation and audit handlers - test(auth): cover passwords, sessions, rate limiter, authorization and audit builders - test(api): cover the api framework, sessions, client origin, headers and cross-origin refusal - test(api): cover account, user, delegation and audit handlers and the authorization matrix - test(ui): cover login, logout, page routes and the page authorization matrix
This commit is contained in:
1 parent
23bec143e3
commit
99fa5de747
28 files changed
+6591
-243
No files matched your search
+2
-11
@@ -23,15 +23,6 @@ const (
|
||||
auditMaxListLimit = 1000
|
||||
)
|
||||
|
||||
var auditStoreChangeOperations = []string{
|
||||
"login", "logout", "password_change",
|
||||
"zone_create", "zone_delete",
|
||||
"record_create", "record_update", "record_delete", "record_bulk_delete", "soa_update",
|
||||
"zone_import",
|
||||
"delegation_grant", "delegation_revoke",
|
||||
"user_create", "user_role", "user_password", "user_delete",
|
||||
}
|
||||
|
||||
type auditFilter struct {
|
||||
Zone string
|
||||
Actor string
|
||||
@@ -127,9 +118,9 @@ func auditFilterSQL(f auditFilter) (string, []any, error) {
|
||||
if f.Kind == auditKindRead {
|
||||
op = "NOT IN"
|
||||
}
|
||||
marks := strings.TrimSuffix(strings.Repeat("?, ", len(auditStoreChangeOperations)), ", ")
|
||||
marks := strings.TrimSuffix(strings.Repeat("?, ", len(auditChangeOperations)), ", ")
|
||||
conds = append(conds, "a.`operation` "+op+" ("+marks+")")
|
||||
for _, o := range auditStoreChangeOperations {
|
||||
for _, o := range auditChangeOperations {
|
||||
args = append(args, o)
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user