pocketid

package
v1.26.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: CC0-1.0 Imports: 10 Imported by: 0

Documentation

Overview

Package pocketid provides a Go client for interacting with the PocketID API.

PocketID is an identity provider for your homelab. This client allows you to manage users, groups, OIDC clients, API keys, and more.

The client uses a standard HTTP client for all API interactions, allowing for customization of timeouts, transport, and other settings.

This was generated from the Swagger docs with Google Gemini.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKeyCreateDto

type ApiKeyCreateDto struct {
	Name        string    `json:"name" validate:"required,min=3,max=50"`
	Description string    `json:"description"`
	ExpiresAt   time.Time `json:"expiresAt" validate:"required"`
}

ApiKeyCreateDto represents the request body for creating a new API key.

func (ApiKeyCreateDto) Valid

func (t ApiKeyCreateDto) Valid() error

Valid validates the ApiKeyCreateDto fields.

type ApiKeyDto

type ApiKeyDto struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	CreatedAt   string `json:"createdAt"`
	ExpiresAt   string `json:"expiresAt"`
	LastUsedAt  string `json:"lastUsedAt"`
}

ApiKeyDto represents an API key.

type ApiKeyResponseDto

type ApiKeyResponseDto struct {
	ApiKey *ApiKeyDto `json:"apiKey"`
	Token  string     `json:"token"`
}

ApiKeyResponseDto represents the response body when creating a new API key.

type AppConfigUpdateDto

type AppConfigUpdateDto struct {
	AppName                            string `json:"appName" validate:"required,min=1,max=30"`
	AllowOwnAccountEdit                string `json:"allowOwnAccountEdit" validate:"required"`
	EmailLoginNotificationEnabled      string `json:"emailLoginNotificationEnabled" validate:"required"`
	EmailOneTimeAccessEnabled          string `json:"emailOneTimeAccessEnabled" validate:"required"`
	EmailsVerified                     string `json:"emailsVerified" validate:"required"`
	LdapEnabled                        string `json:"ldapEnabled" validate:"required"`
	SessionDuration                    string `json:"sessionDuration" validate:"required"`
	SmtpTls                            string `json:"smtpTls" validate:"required,oneof=none starttls tls"`
	LdapAttributeAdminGroup            string `json:"ldapAttributeAdminGroup"`
	LdapAttributeGroupMember           string `json:"ldapAttributeGroupMember"`
	LdapAttributeGroupName             string `json:"ldapAttributeGroupName"`
	LdapAttributeGroupUniqueIdentifier string `json:"ldapAttributeGroupUniqueIdentifier"`
	LdapAttributeUserEmail             string `json:"ldapAttributeUserEmail"`
	LdapAttributeUserFirstName         string `json:"ldapAttributeUserFirstName"`
	LdapAttributeUserLastName          string `json:"ldapAttributeUserLastName"`
	LdapAttributeUserProfilePicture    string `json:"ldapAttributeUserProfilePicture"`
	LdapAttributeUserUniqueIdentifier  string `json:"ldapAttributeUserUniqueIdentifier"`
	LdapAttributeUserUsername          string `json:"ldapAttributeUserUsername"`
	LdapBase                           string `json:"ldapBase"`
	LdapBindDn                         string `json:"ldapBindDn"`
	LdapBindPassword                   string `json:"ldapBindPassword"`
	LdapSkipCertVerify                 string `json:"ldapSkipCertVerify"`
	LdapUrl                            string `json:"ldapUrl"`
	LdapUserGroupSearchFilter          string `json:"ldapUserGroupSearchFilter"`
	LdapUserSearchFilter               string `json:"ldapUserSearchFilter"`
	SmtpFrom                           string `json:"smtpFrom"`
	SmtpHost                           string `json:"smtpHost"`
	SmtpPassword                       string `json:"smtpPassword"`
	SmtpPort                           string `json:"smtpPort"`
	SmtpSkipCertVerify                 string `json:"smtpSkipCertVerify"`
	SmtpUser                           string `json:"smtpUser"`
}

AppConfigUpdateDto represents the request body for updating application configuration.

type AppConfigVariableDto

type AppConfigVariableDto struct {
	IsPublic bool   `json:"isPublic"`
	Key      string `json:"key"`
	Type     string `json:"type"`
	Value    string `json:"value"`
}

AppConfigVariableDto represents an application configuration variable.

type AuditLogData

type AuditLogData map[string]string

AuditLogData is a custom type representing additional data in the AuditLogDto.

type AuditLogDto

type AuditLogDto struct {
	ID        string        `json:"id"`
	UserID    string        `json:"userID"`
	Event     AuditLogEvent `json:"event"`
	IPAddress string        `json:"ipAddress"`
	Device    string        `json:"device"`
	City      string        `json:"city"`
	Country   string        `json:"country"`
	CreatedAt string        `json:"createdAt"`
	Data      AuditLogData  `json:"data"` // Custom type for nested JSON object
}

AuditLogDto represents an audit log entry.

type AuditLogEvent

type AuditLogEvent string

AuditLogEvent represents the type of event in an audit log.

const (
	AuditLogEventSignIn                   AuditLogEvent = "SIGN_IN"
	AuditLogEventOneTimeAccessTokenSignIn AuditLogEvent = "TOKEN_SIGN_IN"
	AuditLogEventClientAuthorization      AuditLogEvent = "CLIENT_AUTHORIZATION"
	AuditLogEventNewClientAuthorization   AuditLogEvent = "NEW_CLIENT_AUTHORIZATION"
)

Constants for AuditLogEvent.

type AuthorizationRequiredDto

type AuthorizationRequiredDto struct {
	ClientID string `json:"clientID" validate:"required"`
	Scope    string `json:"scope" validate:"required"`
}

AuthorizationRequiredDto is used to check if authorization is required.

type AuthorizeOidcClientRequestDto

type AuthorizeOidcClientRequestDto struct {
	ClientID            string `json:"clientID" validate:"required"`
	Scope               string `json:"scope" validate:"required"`
	CallbackURL         string `json:"callbackURL"`
	CodeChallenge       string `json:"codeChallenge"`
	CodeChallengeMethod string `json:"codeChallengeMethod"`
	Nonce               string `json:"nonce"`
}

AuthorizeOidcClientRequestDto represents the request body for authorizing an OIDC client.

type AuthorizeOidcClientResponseDto

type AuthorizeOidcClientResponseDto struct {
	CallbackURL string `json:"callbackURL"`
	Code        string `json:"code"`
}

AuthorizeOidcClientResponseDto represents the response body for authorizing an OIDC client.

type Client

type Client struct {
	// BaseURL is the base URL for the PocketID API.
	//
	// For example: "https://pocket-id.example.com".
	BaseURL string

	// HTTPClient is the underlying HTTP client used for API requests.
	//
	// This allows for customization of timeouts, transport, and other settings.
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client is the main client for interacting with the PocketID API.

Use NewClient to create a new instance.

func NewClient

func NewClient(baseURL string, apiKey string, httpClient *http.Client) *Client

NewClient creates a new PocketID client.

baseURL is the base URL for the PocketID API (e.g., "https://pocket-id.example.com"). apiKey is the API key to use for authentication. httpClient is an optional *http.Client to use for requests. If nil, http.DefaultClient will be used.

func (*Client) AuthorizeOIDCClient

func (c *Client) AuthorizeOIDCClient(request AuthorizeOidcClientRequestDto) (*AuthorizeOidcClientResponseDto, error)

AuthorizeOIDCClient starts the OIDC authorization process for a client.

See https://pocket-id.example.com/oidc/authorize

func (*Client) CheckAuthorizationRequired

func (c *Client) CheckAuthorizationRequired(request AuthorizationRequiredDto) (bool, error)

CheckAuthorizationRequired checks if the user needs to confirm authorization for the client.

See https://pocket-id.example.com/oidc/authorization-required

func (*Client) CreateAPIKey

func (c *Client) CreateAPIKey(apiKeyCreateDto ApiKeyCreateDto) (*ApiKeyResponseDto, error)

CreateAPIKey creates a new API key for the current user.

See https://pocket-id.example.com/api-keys

func (*Client) CreateOIDCClient

func (c *Client) CreateOIDCClient(clientCreateDto OidcClientCreateDto) (*OidcClientWithAllowedUserGroupsDto, error)

CreateOIDCClient creates a new OIDC client.

See https://pocket-id.example.com/oidc/clients

func (*Client) CreateOIDCClientSecret

func (c *Client) CreateOIDCClientSecret(id string) (string, error)

CreateOIDCClientSecret generates a new secret for an OIDC client.

See https://pocket-id.example.com/oidc/clients/{id}/secret

func (*Client) CreateOIDCTokens

func (c *Client) CreateOIDCTokens(clientID, clientSecret, code, grantType, codeVerifier string) (map[string]interface{}, error)

CreateOIDCTokens exchanges an authorization code for ID and access tokens.

See https://pocket-id.example.com/oidc/token

func (*Client) CreateOneTimeAccessTokenForCurrentUser

func (c *Client) CreateOneTimeAccessTokenForCurrentUser(id string, tokenOptions OneTimeAccessTokenCreateDto) (string, error)

CreateOneTimeAccessTokenForCurrentUser generates a one-time access token for the currently authenticated user.

See https://pocket-id.example.com/users/{id}/one-time-access-token

func (*Client) CreateUser

func (c *Client) CreateUser(userCreateDto UserCreateDto) (*UserDto, error)

CreateUser creates a new user.

See https://pocket-id.example.com/users

func (*Client) CreateUserGroup

func (c *Client) CreateUserGroup(userGroupCreateDto UserGroupCreateDto) (*UserGroupDtoWithUsers, error)

CreateUserGroup creates a new user group.

See https://pocket-id.example.com/user-groups

func (*Client) DeleteOIDCClient

func (c *Client) DeleteOIDCClient(id string) error

DeleteOIDCClient deletes an OIDC client by ID.

See https://pocket-id.example.com/oidc/clients/{id}

func (c *Client) DeleteOIDCClientLogo(id string) error

DeleteOIDCClientLogo deletes the logo for an OIDC client.

See https://pocket-id.example.com/oidc/clients/{id}/logo

func (*Client) DeleteUser

func (c *Client) DeleteUser(id string) error

DeleteUser deletes a specific user by ID.

See https://pocket-id.example.com/users/{id}

func (*Client) DeleteUserGroup

func (c *Client) DeleteUserGroup(id string) error

DeleteUserGroup deletes a specific user group by ID.

See https://pocket-id.example.com/user-groups/{id}

func (*Client) EndOIDCSession

func (c *Client) EndOIDCSession(idTokenHint, postLogoutRedirectURI, state string) error

EndOIDCSession ends the user session and handles OIDC logout.

See https://pocket-id.example.com/oidc/end-session

func (*Client) EndOIDCSessionPost

func (c *Client) EndOIDCSessionPost(idTokenHint, postLogoutRedirectURI, state string) error

EndOIDCSessionPost ends the user session and handles OIDC logout using POST.

See https://pocket-id.example.com/oidc/end-session

func (*Client) ExchangeOneTimeAccessToken

func (c *Client) ExchangeOneTimeAccessToken(token string) (*UserDto, error)

ExchangeOneTimeAccessToken exchanges a one-time access token for a session token.

See https://pocket-id.example.com/one-time-access-token/{token}

func (*Client) GetBackgroundImage

func (c *Client) GetBackgroundImage() ([]byte, error)

GetBackgroundImage gets the background image for the application.

See https://pocket-id.example.com/application-configuration/background-image

func (*Client) GetCurrentUser

func (c *Client) GetCurrentUser() (*UserDto, error)

GetCurrentUser retrieves information about the currently authenticated user.

See https://pocket-id.example.com/users/me

func (*Client) GetCurrentUserProfilePicture

func (c *Client) GetCurrentUserProfilePicture() ([]byte, error)

GetCurrentUserProfilePicture retrieves the currently authenticated user's profile picture.

See https://pocket-id.example.com/users/me/profile-picture.png

func (*Client) GetCustomClaimSuggestions

func (c *Client) GetCustomClaimSuggestions() ([]string, error)

GetCustomClaimSuggestions gets a list of suggested custom claim names.

See https://pocket-id.example.com/custom-claims/suggestions

func (*Client) GetFavicon

func (c *Client) GetFavicon() ([]byte, error)

GetFavicon gets the favicon for the application.

See https://pocket-id.example.com/application-configuration/favicon

func (*Client) GetJWKS

func (c *Client) GetJWKS() (map[string]interface{}, error)

GetJWKS returns the JSON Web Key Set used for token verification.

See https://pocket-id.example.com/.well-known/jwks.json

func (c *Client) GetLogo(isLight bool) ([]byte, error)

GetLogo gets the logo image for the application. If isLight is true, the light mode logo is returned.

See https://pocket-id.example.com/application-configuration/logo

func (*Client) GetOIDCClient

func (c *Client) GetOIDCClient(id string) (*OidcClientWithAllowedUserGroupsDto, error)

GetOIDCClient gets detailed information about an OIDC client.

See https://pocket-id.example.com/oidc/clients/{id}

func (c *Client) GetOIDCClientLogo(id string) ([]byte, error)

GetOIDCClientLogo gets the logo image for an OIDC client.

See https://pocket-id.example.com/oidc/clients/{id}/logo

func (*Client) GetOIDCClientMeta

func (c *Client) GetOIDCClientMeta(id string) (*OidcClientMetaDataDto, error)

GetOIDCClientMeta gets OIDC client metadata for discovery and configuration.

See https://pocket-id.example.com/oidc/clients/{id}/meta

func (*Client) GetOpenIDConfiguration

func (c *Client) GetOpenIDConfiguration() (map[string]interface{}, error)

GetOpenIDConfiguration returns the OpenID Connect discovery document.

See https://pocket-id.example.com/.well-known/openid-configuration

func (*Client) GetUserByID

func (c *Client) GetUserByID(id string) (*UserDto, error)

GetUserByID retrieves detailed information about a specific user.

See https://pocket-id.example.com/users/{id}

func (*Client) GetUserGroupByID

func (c *Client) GetUserGroupByID(id string) (*UserGroupDtoWithUsers, error)

GetUserGroupByID retrieves detailed information about a specific user group, including its users.

See https://pocket-id.example.com/user-groups/{id}

func (*Client) GetUserGroups

func (c *Client) GetUserGroups(id string) ([]UserGroupDto, error)

GetUserGroups retrieves all groups a specific user belongs to.

See https://pocket-id.example.com/users/{id}/groups

func (*Client) GetUserInfo

func (c *Client) GetUserInfo(accessToken string) (map[string]interface{}, error)

GetUserInfo gets user information based on the access token.

See https://pocket-id.example.com/oidc/userinfo

func (*Client) GetUserInfoPost

func (c *Client) GetUserInfoPost(accessToken string) (map[string]interface{}, error)

GetUserInfoPost gets user information based on the access token using POST. See https://pocket-id.example.com/oidc/userinfo

func (*Client) GetUserProfilePicture

func (c *Client) GetUserProfilePicture(id string) ([]byte, error)

GetUserProfilePicture retrieves a specific user's profile picture.

See https://pocket-id.example.com/users/{id}/profile-picture.png

func (*Client) ListAPIKeys

func (c *Client) ListAPIKeys(page, limit int, sortColumn, sortDirection string) (*Paginated[ApiKeyDto], error)

ListAPIKeys gets a paginated list of API keys belonging to the current user.

See https://pocket-id.example.com/api-keys

func (*Client) ListAllAppConfig

func (c *Client) ListAllAppConfig() ([]AppConfigVariableDto, error)

ListAllAppConfig gets all application configurations, including private ones.

See https://pocket-id.example.com/application-configuration/all

func (*Client) ListAuditLogs

func (c *Client) ListAuditLogs(page, limit int, sortColumn, sortDirection string) (*Paginated[AuditLogDto], error)

ListAuditLogs gets a paginated list of audit logs for the current user.

See https://pocket-id.example.com/audit-logs

func (*Client) ListOIDCClients

func (c *Client) ListOIDCClients(search string, page, limit int, sortColumn, sortDirection string) (*Paginated[OidcClientDto], error)

ListOIDCClients gets a paginated list of OIDC clients.

See https://pocket-id.example.com/oidc/clients

func (*Client) ListPublicAppConfig

func (c *Client) ListPublicAppConfig() ([]PublicAppConfigVariableDto, error)

ListPublicAppConfig gets all public application configurations.

See https://pocket-id.example.com/application-configuration

func (*Client) ListUserGroups

func (c *Client) ListUserGroups(search string, page, limit int, sortColumn, sortDirection string) (*Paginated[UserGroupDtoWithUserCount], error)

ListUserGroups gets a paginated list of user groups.

See https://pocket-id.example.com/user-groups

func (*Client) ListUsers

func (c *Client) ListUsers(search string, page, limit int, sortColumn, sortDirection string) (*Paginated[UserDto], error)

ListUsers gets a paginated list of users.

See https://pocket-id.example.com/users

func (*Client) RevokeAPIKey

func (c *Client) RevokeAPIKey(id string) error

RevokeAPIKey revokes (deletes) an existing API key by ID.

See https://pocket-id.example.com/api-keys/{id}

func (*Client) SendTestEmail

func (c *Client) SendTestEmail() error

SendTestEmail sends a test email to verify email configuration.

See https://pocket-id.example.com/application-configuration/test-email

func (*Client) SetupInitialAdmin

func (c *Client) SetupInitialAdmin() (*UserDto, error)

SetupInitialAdmin generates a setup access token for initial admin user configuration.

See https://pocket-id.example.com/one-time-access-token/setup

func (*Client) SyncLDAP

func (c *Client) SyncLDAP() error

SyncLDAP manually triggers LDAP synchronization.

See https://pocket-id.example.com/application-configuration/sync-ldap

func (*Client) UpdateAppConfig

func (c *Client) UpdateAppConfig(config AppConfigUpdateDto) ([]AppConfigVariableDto, error)

UpdateAppConfig updates application configuration settings.

See https://pocket-id.example.com/application-configuration

func (*Client) UpdateBackgroundImage

func (c *Client) UpdateBackgroundImage(file io.Reader) error

UpdateBackgroundImage updates the application background image.

See https://pocket-id.example.com/application-configuration/background-image

func (*Client) UpdateCurrentUser

func (c *Client) UpdateCurrentUser(userCreateDto UserCreateDto) (*UserDto, error)

UpdateCurrentUser updates the currently authenticated user's information.

See https://pocket-id.example.com/users/me

func (*Client) UpdateCurrentUserProfilePicture

func (c *Client) UpdateCurrentUserProfilePicture(file io.Reader) error

UpdateCurrentUserProfilePicture updates the currently authenticated user's profile picture.

See https://pocket-id.example.com/users/me/profile-picture

func (*Client) UpdateCustomClaimsForUser

func (c *Client) UpdateCustomClaimsForUser(userID string, claims []CustomClaimDto) ([]CustomClaimDto, error)

UpdateCustomClaimsForUser updates or creates custom claims for a specific user.

See https://pocket-id.example.com/custom-claims/user/{userId}

func (*Client) UpdateCustomClaimsForUserGroup

func (c *Client) UpdateCustomClaimsForUserGroup(userGroupID string, claims []CustomClaimDto) ([]CustomClaimDto, error)

UpdateCustomClaimsForUserGroup updates or creates custom claims for a specific user group.

See https://pocket-id.example.com/custom-claims/user-group/{userGroupId}

func (*Client) UpdateFavicon

func (c *Client) UpdateFavicon(file io.Reader) error

UpdateFavicon updates the application favicon.

See https://pocket-id.example.com/application-configuration/favicon

func (c *Client) UpdateLogo(file io.Reader, isLight bool) error

UpdateLogo updates the application logo. If isLight is true, the light mode logo is updated.

See https://pocket-id.example.com/application-configuration/logo

func (*Client) UpdateOIDCClient

func (c *Client) UpdateOIDCClient(id string, clientCreateDto OidcClientCreateDto) (*OidcClientWithAllowedUserGroupsDto, error)

UpdateOIDCClient updates an existing OIDC client.

See https://pocket-id.example.com/oidc/clients/{id}

func (*Client) UpdateOIDCClientAllowedUserGroups

func (c *Client) UpdateOIDCClientAllowedUserGroups(id string, groups OidcUpdateAllowedUserGroupsDto) (*OidcClientDto, error)

UpdateOIDCClientAllowedUserGroups updates the user groups allowed to access an OIDC client.

See https://pocket-id.example.com/oidc/clients/{id}/allowed-user-groups

func (c *Client) UpdateOIDCClientLogo(id string, file io.Reader) error

UpdateOIDCClientLogo uploads or updates the logo for an OIDC client.

See https://pocket-id.example.com/oidc/clients/{id}/logo

func (*Client) UpdateUser

func (c *Client) UpdateUser(id string, userCreateDto UserCreateDto) (*UserDto, error)

UpdateUser updates an existing user by ID.

See https://pocket-id.example.com/users/{id}

func (*Client) UpdateUserGroup

func (c *Client) UpdateUserGroup(id string, userGroupCreateDto UserGroupCreateDto) (*UserGroupDtoWithUsers, error)

UpdateUserGroup updates an existing user group by ID.

See https://pocket-id.example.com/user-groups/{id}

func (*Client) UpdateUserGroups

func (c *Client) UpdateUserGroups(id string, groupDto UserUpdateUserGroupDto) (*UserDto, error)

UpdateUserGroups updates the groups a specific user belongs to.

See https://pocket-id.example.com/users/{id}/user-groups

func (*Client) UpdateUserProfilePicture

func (c *Client) UpdateUserProfilePicture(id string, file io.Reader) error

UpdateUserProfilePicture updates a specific user's profile picture.

See https://pocket-id.example.com/users/{id}/profile-picture

func (*Client) UpdateUsersInGroup

func (c *Client) UpdateUsersInGroup(id string, users UserGroupUpdateUsersDto) (*UserGroupDtoWithUsers, error)

UpdateUsersInGroup updates the list of users belonging to a specific user group.

See https://pocket-id.example.com/user-groups/{id}/users

type CustomClaimDto

type CustomClaimDto struct {
	Key   string `json:"key" validate:"required"`
	Value string `json:"value" validate:"required"`
}

CustomClaimCreateDto represents the request body for creating or updating custom claims.

func (CustomClaimDto) Valid

func (t CustomClaimDto) Valid() error

Valid validates the CustomClaimCreateDto fields.

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse represents a generic error response from the PocketID API.

type OidcClientCreateDto

type OidcClientCreateDto struct {
	Name               string   `json:"name" validate:"required,max=50"`
	CallbackURLs       []string `json:"callbackURLs" validate:"required"`
	IsPublic           bool     `json:"isPublic"`
	LogoutCallbackURLs []string `json:"logoutCallbackURLs"`
	PkceEnabled        bool     `json:"pkceEnabled"`
}

OidcClientCreateDto represents the request body for creating an OIDC client.

type OidcClientDto

type OidcClientDto struct {
	ID                 string   `json:"id"`
	Name               string   `json:"name"`
	CallbackURLs       []string `json:"callbackURLs"`
	IsPublic           bool     `json:"isPublic"`
	LogoutCallbackURLs []string `json:"logoutCallbackURLs"`
	PkceEnabled        bool     `json:"pkceEnabled"`
}

OidcClientDto represents an OIDC client.

type OidcClientMetaDataDto

type OidcClientMetaDataDto struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
}

OidcClientMetaDataDto represents OIDC client metadata.

type OidcClientWithAllowedUserGroupsDto

type OidcClientWithAllowedUserGroupsDto struct {
	ID                 string                      `json:"id"`
	Name               string                      `json:"name"`
	CallbackURLs       []string                    `json:"callbackURLs"`
	IsPublic           bool                        `json:"isPublic"`
	LogoutCallbackURLs []string                    `json:"logoutCallbackURLs"`
	PkceEnabled        bool                        `json:"pkceEnabled"`
	AllowedUserGroups  []UserGroupDtoWithUserCount `json:"allowedUserGroups"`
}

OidcClientWithAllowedUserGroupsDto represents an OIDC client with allowed user groups.

type OidcUpdateAllowedUserGroupsDto

type OidcUpdateAllowedUserGroupsDto struct {
	UserGroupIds []string `json:"userGroupIds" validate:"required"`
}

OidcUpdateAllowedUserGroupsDto represents the request body for updating allowed user groups.

type OneTimeAccessTokenCreateDto

type OneTimeAccessTokenCreateDto struct {
	ExpiresAt string `json:"expiresAt" validate:"required"`
	UserId    string `json:"userId"` // UserId is optional here, as per the API spec. It's only required in some contexts
}

OneTimeAccessTokenCreateDto represents options for creating a one-time access token.

type Paginated

type Paginated[T any] struct {
	Data       []T        `json:"data"`
	Pagination Pagination `json:"pagination"`
}

Paginated represents a paginated response.

type Pagination

type Pagination struct {
	CurrentPage  int `json:"currentPage"`
	ItemsPerPage int `json:"itemsPerPage"`
	TotalItems   int `json:"totalItems"`
	TotalPages   int `json:"totalPages"`
}

Pagination represents pagination metadata.

type PublicAppConfigVariableDto

type PublicAppConfigVariableDto struct {
	Key   string `json:"key"`
	Type  string `json:"type"`
	Value string `json:"value"`
}

PublicAppConfigVariableDto represents a public application configuration variable.

type UserCreateDto

type UserCreateDto struct {
	Email     string `json:"email" validate:"required,email"`
	FirstName string `json:"firstName" validate:"required,min=1,max=50"`
	LastName  string `json:"lastName" validate:"required,min=1,max=50"`
	Username  string `json:"username" validate:"required,min=2,max=50"`
	IsAdmin   bool   `json:"isAdmin"`
}

UserCreateDto represents the request body for creating a user.

type UserDto

type UserDto struct {
	ID           string           `json:"id"`
	Email        string           `json:"email"`
	FirstName    string           `json:"firstName"`
	LastName     string           `json:"lastName"`
	Username     string           `json:"username"`
	IsAdmin      bool             `json:"isAdmin"`
	LdapId       string           `json:"ldapId"`
	CustomClaims []CustomClaimDto `json:"customClaims"`
	UserGroups   []UserGroupDto   `json:"userGroups"`
}

UserDto represents a user.

type UserGroupCreateDto

type UserGroupCreateDto struct {
	Name         string `json:"name" validate:"required,min=2,max=255"`
	FriendlyName string `json:"friendlyName" validate:"required,min=2,max=50"`
}

UserGroupCreateDto represents the request body for creating a user group.

type UserGroupDto

type UserGroupDto struct {
	ID           string           `json:"id"`
	Name         string           `json:"name"`
	FriendlyName string           `json:"friendlyName"`
	CreatedAt    string           `json:"createdAt"`
	LdapId       string           `json:"ldapId"`
	CustomClaims []CustomClaimDto `json:"customClaims"`
}

UserGroupDto represents a user group.

type UserGroupDtoWithUserCount

type UserGroupDtoWithUserCount struct {
	ID           string           `json:"id"`
	Name         string           `json:"name"`
	FriendlyName string           `json:"friendlyName"`
	CreatedAt    string           `json:"createdAt"`
	LdapId       string           `json:"ldapId"`
	CustomClaims []CustomClaimDto `json:"customClaims"`
	UserCount    int              `json:"userCount"`
}

UserGroupDtoWithUserCount represents a user group with a user count.

type UserGroupDtoWithUsers

type UserGroupDtoWithUsers struct {
	ID           string           `json:"id"`
	Name         string           `json:"name"`
	FriendlyName string           `json:"friendlyName"`
	CreatedAt    string           `json:"createdAt"`
	LdapId       string           `json:"ldapId"`
	CustomClaims []CustomClaimDto `json:"customClaims"`
	Users        []UserDto        `json:"users"`
}

UserGroupDtoWithUsers represents a user group with its users.

type UserGroupUpdateUsersDto

type UserGroupUpdateUsersDto struct {
	UserIds []string `json:"userIds" validate:"required"`
}

UserGroupUpdateUsersDto represents the request body for updating users in a group.

type UserUpdateUserGroupDto

type UserUpdateUserGroupDto struct {
	UserGroupIds []string `json:"userGroupIds" validate:"required"`
}

UserUpdateUserGroupDto represents the request body for updating user groups for a user.

Jump to

Keyboard shortcuts

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