Documentation
¶
Overview ¶
Package auditlog contains logging structs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // LogSync ensure that logs are written sync. // Useful for testing. LogSync bool )
Functions ¶
func WriteAccessLog ¶
WriteAccessLog puts the access log to StackDriver.
func WritePolicyDecisionLog ¶ added in v0.8.5
func WritePolicyDecisionLog(client *logging.Client, log *PolicyDecisionLog)
WritePolicyDecisionLog puts the policy decision log to StackDriver.
Types ¶
type AccessLog ¶
type AccessLog struct { // TokenID is the id of the token, maybe "jti". TokenID string // TokenSubject is the "sub" of the token. TokenSubject string // TokenIssuer is the iss of the token. TokenIssuer string // TracingID is the id of request from proxies. TracingID string // RequestMethod is the http method of the request. RequestMethod string // RequestEndpoint is the absolute path of the request. RequestEndpoint string // RequestIP is the requester IP. RequestIP string // ErrorType formats like "no_token" for search. ErrorType string // ResponseCode is the response code. ResponseCode int // Request stores the http.Request. Request *http.Request // PassAuthCheck if the request pass the auth checker. PassAuthCheck bool // Payload of the log. Payload interface{} }
AccessLog logs the http endpoint accessing.
type PolicyDecisionLog ¶ added in v0.8.5
type PolicyDecisionLog struct { // TokenID is the id of the token, maybe "jti". TokenID string // TokenSubject is the "sub" of the token. TokenSubject string // TokenIssuer is the iss of the token. TokenIssuer string // Resource identifies the dataset. Resource string // TTL that user requested to grant. TTL string // PassAuthCheck if the request pass the auth checker. PassAuthCheck bool // ErrorType of deny. ErrorType string // Message of deny. Message interface{} }
PolicyDecisionLog logs the dataset access request be granted or denied and the reason.
Click to show internal directories.
Click to hide internal directories.