Documentation ¶
Overview ¶
Package authenticate is build to authenticate the API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Jwks *jwk.Cache
Functions ¶
func CreateOidcUser ¶
CreateOidcUser creates a new user via oidc id token
@Summary Create new user via oidc id token @Description Create a new service user via oidc id token @Id CreateOidcUser @Tags Users @Accept json @Produce json @Success 201 {object} models.UserResponse @Failure 400 {object} models.LicenseError "Invalid json body" @Failure 409 {object} models.LicenseError "User already exists" @Router /users/oidc [post]
func CreateUser ¶
CreateUser creates a new user
@Summary Create new user @Description Create a new service user @Id CreateUser @Tags Users @Accept json @Produce json @Param user body models.UserCreate true "User to create" @Success 201 {object} models.UserResponse @Failure 400 {object} models.LicenseError "Invalid json body" @Failure 409 {object} models.LicenseError "User already exists" @Security ApiKeyAuth @Router /users [post]
func DeleteUser ¶
DeleteUser marks an existing user record as inactive
@Summary Deactivate user @Description Deactivate an user @Id DeleteUser @Tags Users @Accept json @Produce json @Param username path string true "Username of the user to be marked as inactive" @Success 204 @Failure 404 {object} models.LicenseError "No user with given username found" @Security ApiKeyAuth @Router /users/{username} [delete]
func GetAllUser ¶
GetAllUser retrieves a list of all users from the database.
@Summary Get users @Description Get all service users @Id GetAllUsers @Tags Users @Accept json @Produce json @Param active query bool false "Active user only" @Param page query int false "Page number" @Param limit query int false "Number of records per page" @Success 200 {object} models.UserResponse @Failure 404 {object} models.LicenseError "Users not found" @Security ApiKeyAuth @Router /users [get]
func GetUser ¶
GetUser retrieves a user by their user ID from the database.
@Summary Get a user @Description Get a single user by username @Id GetUser @Tags Users @Accept json @Produce json @Param username path string true "Username" @Success 200 {object} models.UserResponse @Failure 400 {object} models.LicenseError "Invalid user id" @Failure 404 {object} models.LicenseError "User not found" @Security ApiKeyAuth @Router /users/{username} [get]
func Login ¶
Login user and get JWT tokens
@Summary Login @Description Login to get JWT token @Id Login @Tags Users @Accept json @Produce json @Param user body models.UserLogin true "Login credentials" @Success 200 {object} object{token=string} "JWT token" @Failure 401 {object} models.LicenseError "Incorrect username or password" @Router /login [post]
func UpdateProfile ¶
UpdateProfile updates one's user profile
@Summary Users can update their profile using this endpoint @Description Users can update their profile using this endpoint @Id UpdateProfile @Tags Users @Accept json @Produce json @Param user body models.ProfileUpdate true "Profile fields to update" @Success 200 {object} models.UserResponse @Failure 400 {object} models.LicenseError "Invalid json body" @Security ApiKeyAuth @Router /users [patch]
func UpdateUser ¶
UpdateUser updates a user, requires admin rights
@Summary Update user, requires admin rights @Description Update a service user, requires admin rights @Id UpdateUser @Tags Users @Accept json @Produce json @Param username path string true "username of the user to be updated" @Param user body models.UserUpdate true "User to update" @Success 200 {object} models.UserResponse @Failure 400 {object} models.LicenseError "Invalid json body" @Failure 403 {object} models.LicenseError "This resource requires elevated access rights" @Security ApiKeyAuth @Router /users/{username} [patch]
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.