Documentation
¶
Index ¶
Constants ¶
const AuthTokenKey = "auth_token_id"
AuthTokenKey is set in the gin context when a request was authenticated with an access token instead of a browser session.
const PersonalPrefix = "ahp_"
PersonalPrefix starts every personal access token. Project and node tokens are UUIDs, so the prefix tells the two kinds apart.
Variables ¶
This section is empty.
Functions ¶
func IsPersonal ¶ added in v1.1.0
IsPersonal tells whether the header value is a personal token.
func NewPersonal ¶ added in v1.1.0
NewPersonal returns a new personal token, the value to store in AccessToken.Token and a hint (the last characters) to show in lists.
func NodeRoute ¶ added in v1.1.0
NodeRoute tells whether a node token may be used for the path: the node endpoints of the master (/node/...) and the bundles it installs (/upload/...).
func SessionHandler ¶
func SessionHandler(db *gorm.DB, handler gin.HandlerFunc) gin.HandlerFunc
SessionHandler authenticates requests that carry an X-Auth-Token header and hands every other request to handler (the browser session guard).
func StoredPersonal ¶ added in v1.1.0
StoredPersonal returns the stored form (hash) of a personal token.
Types ¶
This section is empty.