Documentation ¶
Overview ¶
Package idputil contains utility routines common to many identity providers.
Index ¶
- Variables
- func DischargeID(req *http.Request) string
- func GetLoginMethods(ctx context.Context, c *httprequest.Client, u *url.URL, v interface{}) error
- func NameWithDomain(name, domain string) string
- func RegistrationForm(ctx context.Context, w http.ResponseWriter, params RegistrationParams, ...) error
- func RequestParams(ctx context.Context, w http.ResponseWriter, req *http.Request) httprequest.Params
- func URL(prefix, path, dischargeID string) string
- type RegistrationParams
Constants ¶
This section is empty.
Variables ¶
View Source
var ReservedUsernames = map[string]bool{ "admin": true, "everyone": true, }
Functions ¶
func DischargeID ¶
WaitID gets the wait ID from the given request using the standard form value.
func GetLoginMethods ¶
GetLoginMethods uses c to perform a request to get the list of available login methods from u. The result is unmarshalled into v.
func NameWithDomain ¶
NameWithDomain builds a name out of name and domain. If domain is empty then name is returned unchanged.
func RegistrationForm ¶
func RegistrationForm(ctx context.Context, w http.ResponseWriter, params RegistrationParams, t *template.Template) error
RegistrationForm writes a registration form to the given writer using the given parameters.
func RequestParams ¶
func RequestParams(ctx context.Context, w http.ResponseWriter, req *http.Request) httprequest.Params
RequestParams creates an httprequest.Params object from the given fields.
Types ¶
type RegistrationParams ¶
type RegistrationParams struct { // State contains some opaque state for the registration. It can // be used to pass arbitrary data back to the idp once the // registration is processed. State string // Username contains the preferred username for the user. This // will be used to populate the username input. Username string // Error contains an error message if the registration failed. Error string // Domain contains the domain in which the user is being created. // This cannot be modified by the user. Domain string // FullName contains the full name of the user. This is used to // populate the fullname input. FullName string // Email contains the email address of the user. This is used to // populate the email input. Email string }
Click to show internal directories.
Click to hide internal directories.