Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions internal/admin/principal.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ func (r Role) AllowsWrite() bool {
return r == RoleFull
}

// AllowsRead reports whether the role may execute sensitive read
// operations that surface payload content (e.g. SQS AdminPeekQueue,
// which exposes message bodies and attributes). Both RoleReadOnly and
// RoleFull satisfy the gate; the zero value (unauthenticated /
// role-less principal) does not. List / Describe endpoints use the
// looser session-auth gate because their output is metadata; peek
// diverges because the payload is the stored message itself.
func (r Role) AllowsRead() bool {
return r == RoleReadOnly || r == RoleFull
}

// AuthPrincipal is the authenticated caller derived from a session cookie or,
// in the future, a follower→leader forwarded request. The admin handler and
// adapter internal entrypoints pass it around instead of a raw HTTP request
Expand Down
Loading
Loading