users

package
v0.0.54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

README

routes/users

HTTP route handlers for user and credential management. Provides two endpoints: one that returns all current credentials for every user, team, and userlist (intended for admin/internal use); and one that accepts a password change request containing a team number, userlist name, username, and new password, validates that the userlist name exists in the config, and updates the credential in the database.

Documentation

Overview

Package users contains all the API routes involving scoring users. This includes PCRs, as well as enumeration routes that can be used by frontends to create PCR pages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllUsers

func GetAllUsers(c *gin.Context)

GetAllUsers returns all users from all userlists and their up to date passwords for all teams.

@Summary		Get all scoring users
@Description	Returns every user in every userlist for every team, including current passwords. Shape: {"team": {"userlist": [User]}}.
@Tags			users
@Produce		json
@Success		200	{object}	map[string]map[string][]types.User
@Failure		400	{object}	object
@Router			/users [get]

func GetUserLists

func GetUserLists(c *gin.Context)

GetUserLists is a route that returns descriptions of all userlists. Notably it does not actually return any usernames or passwords. This is intended for use to generate an obfuscated PCR form (like CCDC).

func SubmitPCR

func SubmitPCR(c *gin.Context)

SubmitPCR is a POST route for changing a scoring users password.

@Summary		Submit a password change request (PCR)
@Description	Updates the password for a scoring user in the specified userlist for the specified team.
@Tags			users
@Accept			json
@Produce		json
@Param			pcr	body		PCR		true	"Password change request"
@Success		200	{object}	object
@Failure		400	{object}	object
@Failure		500	{object}	object
@Failure		501	{object}	object
@Router			/users [post]

Types

type PCR

type PCR struct {
	types.User
	UserListName types.UserListName `json:"user_list" example:"local users"`
	TeamNum      types.TeamNum      `json:"team_num"  example:"1"`
}

PCR is the JSON object that must be posted to the server to complete a PCR.

type UserListInfo

type UserListInfo struct {
	Name    types.UserListName `json:"name"`
	Domain  string             `json:"domain"`
	NetBIOS string             `json:"netbios"`
}

UserListInfo represents a description of a userlist. This can be used by a frontend to create a PCR form that does not exposes usernames/passwords.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL