Documentation ¶
Index ¶
- Variables
- type Creds
- type Emailer
- type Error
- type UsersAPI
- func (u *UsersAPI) Authorize(creds Creds) bool
- func (u *UsersAPI) CreateUser(creds Creds, usr schema.User, redirURL url.URL) (schema.UserCreateResponse, error)
- func (u *UsersAPI) DisableUser(creds Creds, userID string, disable bool) (schema.UserDisableResponse, error)
- func (u *UsersAPI) GetUser(creds Creds, id string) (schema.User, error)
- func (u *UsersAPI) ListClientsWithRefreshTokens(creds Creds, userID string) ([]*schema.RefreshClient, error)
- func (u *UsersAPI) ListUsers(creds Creds, maxResults int, nextPageToken string) ([]*schema.User, string, error)
- func (u *UsersAPI) ResendEmailInvitation(creds Creds, userID string, redirURL url.URL) (schema.ResendEmailInvitationResponse, error)
- func (u *UsersAPI) RevokeRefreshTokensForClient(creds Creds, userID, clientID string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorInvalidEmail = newError("invalid_email", "invalid email.", http.StatusBadRequest) ErrorVerifiedEmail = newError("verified_email", "Email already verified.", http.StatusBadRequest) ErrorInvalidClient = newError("invalid_client", "invalid email.", http.StatusBadRequest) ErrorDuplicateEmail = newError("duplicate_email", "Email already in use.", http.StatusBadRequest) ErrorResourceNotFound = newError("resource_not_found", "Resource could not be found.", http.StatusNotFound) ErrorForbidden = newError("forbidden", "The given user and client are not authorized to make this request.", http.StatusForbidden) ErrorMaxResultsTooHigh = newError("max_results_too_high", fmt.Sprintf("The max number of results per page is %d", maxUsersPerPage), http.StatusBadRequest) ErrorInvalidRedirectURL = newError("invalid_redirect_url", "The provided redirect URL is invalid for the given client", http.StatusBadRequest) )
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct { Type string // The HTTP Code to return for this type of error. Code int Desc string // The underlying error - not to be consumed by external users. Internal error }
Error is the error type returned by AdminAPI methods.
type UsersAPI ¶
type UsersAPI struct {
// contains filtered or unexported fields
}
All calls take a Creds object with the ClientID of the calling app and the calling User. It is assumed that the clientID has already validated as an admin app before calling.
func NewUsersAPI ¶
func NewUsersAPI(userManager *usermanager.UserManager, clientManager *clientmanager.ClientManager, refreshRepo refresh.RefreshTokenRepo, emailer Emailer, localConnectorID string) *UsersAPI
TODO(ericchiang): Don't pass a dbMap. See #385.
func (*UsersAPI) CreateUser ¶
func (*UsersAPI) DisableUser ¶ added in v0.2.0
func (*UsersAPI) ListClientsWithRefreshTokens ¶ added in v0.5.0
func (u *UsersAPI) ListClientsWithRefreshTokens(creds Creds, userID string) ([]*schema.RefreshClient, error)
ListClientsWithRefreshTokens returns all clients issued refresh tokens for the authenticated user.
func (*UsersAPI) ResendEmailInvitation ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.