Documentation ¶
Index ¶
- Constants
- func AuthnHandler(inner http.Handler, c *config.Config) http.Handler
- func GetIdentity(ctx context.Context) (id goidentity.Identity, err error)
- func MethodNotAllowed() http.HandlerFunc
- func NewRouter(c *config.Config, stmtMap *database.StmtMap, fc *federationuser.FedUserCache) *mux.Router
- func ParseAuthorizationHeader(r *http.Request) (mechanism, value string, err error)
- func ParseBasicHeaderValue(s string) (domain, username, password string, err error)
- func WrapCommonHandler(inner http.Handler, authn bool, c *config.Config) http.Handler
- type AccessLog
- type JSONCreatedResponse
- type JSONGenericResponse
- type LDAPBasicAuthenticator
- type ResponseWriterWrapper
- type Route
- type StaticAuthenticator
Constants ¶
View Source
const ( MuxVarAccountID = "accountID" AccountAPI = "account" AccountGETTmpl = "" /* 194-byte string literal not displayed */ AccountPOSTTmpl = "{\"ID\":\"%s\",\"Email\":\"%s\",\"Name\":\"%s\",\"Type\":{\"ID\":%d},\"Status\":{\"ID\":%d},\"FederationUserARN\":\"%s\"}" )
View Source
const ( MuxVarAccountClassID = "accountClassID" AccountClassAPI = "accountclass" AccountClassPOSTTmpl = "{\"Class\":\"%s\"}" AccountClassPUTTmpl = "{\"ID\":%d,\"Class\":\"%s\"}" )
View Source
const ( MuxVarAccountStatusID = "accountStatusID" AccountStatusAPI = "accountstatus" AccountStatusPOSTTmpl = "{\"Status\":\"%s\"}" AccountStatusPUTTmpl = "{\"ID\":%d,\"Status\":\"%s\"}" )
View Source
const ( MuxVarAccountTypeID = "accountTypeID" AccountTypeAPI = "accounttype" AccountTypeGETTmpl = "{\"ID\":%d,\"Type\":\"%s\",\"Class\":{\"ID\":%d}}" AccountTypePOSTTmpl = "{\"Type\":\"%s\",\"Class\":{\"ID\":%d}}" AccountTypePUTTmpl = "{\"ID\":%d,\"Type\":\"%s\",\"Class\":{\"ID\":%d}}" )
View Source
const ( AuthMechanismNegotiate = "Negotiate" AuthMechanismBasic = "Basic" AuthMechanismBearer = "Bearer" )
View Source
const ( MuxVarUsername = "username" FederationUserAPI = "federationuser" FederationUserResponseTmpl = "" /* 221-byte string literal not displayed */ FederationUserPOSTTmpl = "" /* 205-byte string literal not displayed */ )
View Source
const ( FilterAuthz = "authz" FilterARN = "arn" FilterAccountIDs = "account" RoleMappingAPI = "rolemapping" RoleMappingPOSTTmpl = "{\"RoleARN\":\"%s\",\"AuthzAttribute\":\"%s\"}" RoleMappingPUTTmpl = "{\"ID\":\"%s\",\"RoleARN\":\"%s\",\"AuthzAttribute\":\"%s\"}" RoleMappingGETTmpl = "{\"ID\":\"%s\",\"RoleARN\":\"%s\",\"AuthzAttribute\":\"%s\",\"AccountID\":\"%s\"}" )
View Source
const (
APIVersion = "v1"
)
View Source
const (
MuxVarRoleUUID = "roleUUID"
)
Variables ¶
This section is empty.
Functions ¶
func GetIdentity ¶
func GetIdentity(ctx context.Context) (id goidentity.Identity, err error)
func MethodNotAllowed ¶
func MethodNotAllowed() http.HandlerFunc
func NewRouter ¶
func NewRouter(c *config.Config, stmtMap *database.StmtMap, fc *federationuser.FedUserCache) *mux.Router
func ParseBasicHeaderValue ¶
Types ¶
type AccessLog ¶
type AccessLog struct { SourceIP string `json:"SourceIP"` Username string `json:"Username"` UserDomain string `json:"UserRealm"` StatusCode int `json:"StatusCode"` Method string `json:"Method"` ServerHost string `json:"ServerHost"` Path string `json:"Path"` QueryString string `json:"QueryString"` Time time.Time `json:"Time"` Duration time.Duration `json:"Duration"` }
type JSONCreatedResponse ¶
type JSONGenericResponse ¶
type LDAPBasicAuthenticator ¶
type LDAPBasicAuthenticator struct { BasicHeaderValue string LDAPConfig config.LDAPBasic // contains filtered or unexported fields }
func (LDAPBasicAuthenticator) Authenticate ¶
func (a LDAPBasicAuthenticator) Authenticate() (i goidentity.Identity, ok bool, err error)
func (LDAPBasicAuthenticator) Mechanism ¶
func (a LDAPBasicAuthenticator) Mechanism() string
type ResponseWriterWrapper ¶
type ResponseWriterWrapper struct { http.ResponseWriter // contains filtered or unexported fields }
func NewResponseWriterWrapper ¶
func NewResponseWriterWrapper(w http.ResponseWriter) *ResponseWriterWrapper
func (*ResponseWriterWrapper) Status ¶
func (w *ResponseWriterWrapper) Status() int
func (*ResponseWriterWrapper) Write ¶
func (w *ResponseWriterWrapper) Write(p []byte) (n int, err error)
func (*ResponseWriterWrapper) WriteHeader ¶
func (w *ResponseWriterWrapper) WriteHeader(code int)
type StaticAuthenticator ¶
type StaticAuthenticator struct { BasicHeaderValue string RequiredSecret string StaticAttribute string // contains filtered or unexported fields }
StaticAuthenticator is mainly for testing purposes. Do not use in production.
func (StaticAuthenticator) Authenticate ¶
func (a StaticAuthenticator) Authenticate() (i goidentity.Identity, ok bool, err error)
func (StaticAuthenticator) Mechanism ¶
func (a StaticAuthenticator) Mechanism() string
Click to show internal directories.
Click to hide internal directories.