Documentation ¶
Index ¶
Constants ¶
View Source
const ( // KeyUserID is identifier to get the current user's ID from the session store KeyUserID = "Grac-Session-User-Id" // KeyUserRole is the identifier to get the current user's role from the session store KeyUserRole = "Grac-Session-User-Role" // KeyDeleteSession is the identifier to check whether the session should be deleted KeyDeleteSession = "Grac-Is-Delete-Session" // KeyAuthorization is the key to look for the authorization header KeyAuthorization = "authorization" // KeyUserCSRFToken is the identifier for csrf token KeyUserCSRFToken = "X-Xsrf-Token" // ErrFailedTokenGeneration is to show when the token generation fails ErrFailedTokenGeneration = "GRAC Error: Failed to generate access token" )
Variables ¶
This section is empty.
Functions ¶
func GetRequestFromContext ¶ added in v0.0.5
GetRequestFromContext pulls the request from context (set in middleware above)
Types ¶
type Modifier ¶
type Modifier struct {
// contains filtered or unexported fields
}
Modifier defines a store to save session
func NewModifier ¶ added in v0.0.2
func NewModifier(store *redisstore.RedisStore, config interface{}) *Modifier
NewModifier returns a gateway input/output modifier
func (*Modifier) MetadataAnnotator ¶
MetadataAnnotator looks up session and passes session data and jwt token to gRPC method
func (*Modifier) ResponseModifier ¶ added in v0.0.2
func (m *Modifier) ResponseModifier(ctx context.Context, w http.ResponseWriter, resp protoiface.MessageV1) error
ResponseModifier checks whether the gRPC method called has requested for changing the response before the http response is sent
Click to show internal directories.
Click to hide internal directories.