auth

Paddy 2015-01-18 Parent:0a1e16b9c141 Child:23c1a07c8a61

124:d14f0a81498c Go to Latest

auth/session.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.

History
     1.1 --- a/session.go	Sun Jan 18 04:54:02 2015 -0500
     1.2 +++ b/session.go	Sun Jan 18 05:03:17 2015 -0500
     1.3 @@ -25,6 +25,7 @@
     1.4  		Invalidate:    nil,
     1.5  		IssuesRefresh: true,
     1.6  		ReturnToken:   RenderJSONToken,
     1.7 +		AuditString:   credentialsAuditString,
     1.8  	})
     1.9  }
    1.10  
    1.11 @@ -301,3 +302,7 @@
    1.12  	valid = true
    1.13  	return
    1.14  }
    1.15 +
    1.16 +func credentialsAuditString(r *http.Request) string {
    1.17 +	return "credentials"
    1.18 +}