Documentation
¶
Index ¶
Constants ¶
View Source
const SubjectClaim = "sub"
SubjectClaim is the standard token claim that identifies the user.
Variables ¶
This section is empty.
Functions ¶
func GetOwnerSubjectFromContext ¶
GetOwnerSubjectFromContext extracts the authenticated owner's subject (UID) from the request context
func OwnerSubject ¶ added in v0.6.0
OwnerSubject returns middleware that adds the data owner's UID to the request context. It must run after internal/authn's RequireAuthMiddleware, which has already validated the token. The UID is read from claim: "sub" is the token's subject, and any other claim (e.g. "nic") is read from its extra claims. A token without the claim is rejected with 401.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.