Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitJWTValidator ¶
func InitJWTValidator(auth0Domain string, configBucket string, pemPath string, fs fileaccess.FileAccess) (*auth0.JWTValidator, error)
Types ¶
type IJWTReader ¶
type IJWTReader interface { GetValidator() JWTInterface GetUserInfo(*http.Request) (JWTUserInfo, error) }
IJWTReader - User ID getter from HTTP request
type JWTInterface ¶
type JWTInterface interface { ValidateRequest(r *http.Request) (*jwt.JSONWebToken, error) Claims(r *http.Request, token *jwt.JSONWebToken, values ...interface{}) error }
Implements a JWT validation and claim extraction interface
type JWTUserInfo ¶
type MockJWTValidator ¶
type MockJWTValidator struct { }
func (*MockJWTValidator) Claims ¶
func (v *MockJWTValidator) Claims(r *http.Request, token *jwt.JSONWebToken, values ...interface{}) error
func (*MockJWTValidator) ValidateRequest ¶
func (v *MockJWTValidator) ValidateRequest(r *http.Request) (*jwt.JSONWebToken, error)
type RealJWTReader ¶
type RealJWTReader struct {
Validator JWTInterface
}
RealJWTReader - Reader
func (RealJWTReader) GetSimpleUserInfo ¶
func (j RealJWTReader) GetSimpleUserInfo(r *http.Request) (JWTUserInfo, error)
GetSimpleUserInfo - Get Simple User Info TODO: See note for GetUserInfo about user impersonation
func (RealJWTReader) GetUserInfo ¶
func (j RealJWTReader) GetUserInfo(r *http.Request) (JWTUserInfo, error)
GetUserInfo - Get User Info TODO: When a user is impersonating another, this still returns the real users details
from the JWT. This is unfortunate but seemed more effort than it's worth to fix because we'll mainly test with science team members who have similar auth0 permissions, similar groups, similar access to datasets. If we do encounter issues we can look at adding a map of userid->UserInfo structs containing the impersonated users details, and return that from here
func (RealJWTReader) GetValidator ¶
func (j RealJWTReader) GetValidator() JWTInterface
Click to show internal directories.
Click to hide internal directories.