auth
auth/client.go
Fill out token.CreatedFrom. Add a GrantType.AuditString() string method that will return a string for an audit log. Basically, it returns enough information to identify how the token got created. For client credentials, that's just the string "client_credentials". For user credentials, that's just the string "credentials". For auth codes, that's "authcode:", followed by the code used. For refresh tokens, that's "refresh_token:", followed by the refresh token used.
1.1 --- a/client.go Sun Jan 18 04:54:02 2015 -0500 1.2 +++ b/client.go Sun Jan 18 05:03:17 2015 -0500 1.3 @@ -24,6 +24,7 @@ 1.4 IssuesRefresh: true, 1.5 ReturnToken: RenderJSONToken, 1.6 AllowsPublic: false, 1.7 + AuditString: clientCredentialsAuditString, 1.8 }) 1.9 } 1.10 1.11 @@ -487,3 +488,7 @@ 1.12 valid = true 1.13 return 1.14 } 1.15 + 1.16 +func clientCredentialsAuditString(r *http.Request) string { 1.17 + return "client_credentials" 1.18 +}