Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidCredentials = errors.New("invalid credentials")
)
Functions ¶
func ObtainOpenshiftToken ¶
func ObtainOpenshiftToken(username, password string, logger *zap.Logger, ctx *gin.Context) (string, error)
ObtainOpenshiftToken obtains an OAuth token from OpenShift using the provided username and password. It returns the access token on success, or an error on failure. This code was taken from https://gist.github.com/kadel/c30b3085e2e90a93393b99a2b39f4806, with minor adjustments.
Types ¶
type DefaultTokenProvider ¶
type DefaultTokenProvider struct{}
DefaultTokenProvider is a default implementation of TokenProvider.
func (DefaultTokenProvider) ObtainToken ¶
func (DefaultTokenProvider) ObtainUsername ¶
type OpenshiftUserInfo ¶
type OpenshiftUserInfo struct {
Metadata struct {
Name string `json:"name"`
} `json:"metadata"`
}
OpenshiftUserInfo represents the structure of the user info response from OpenShift.
Click to show internal directories.
Click to hide internal directories.