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 ¶
- type ApiKeyCreateDto
- type ApiKeyDto
- type ApiKeyResponseDto
- type AppConfigUpdateDto
- type AppConfigVariableDto
- type AuditLogData
- type AuditLogDto
- type AuditLogEvent
- type AuthorizationRequiredDto
- type AuthorizeOidcClientRequestDto
- type AuthorizeOidcClientResponseDto
- type Client
- func (c *Client) AuthorizeOIDCClient(request AuthorizeOidcClientRequestDto) (*AuthorizeOidcClientResponseDto, error)
- func (c *Client) CheckAuthorizationRequired(request AuthorizationRequiredDto) (bool, error)
- func (c *Client) CreateAPIKey(apiKeyCreateDto ApiKeyCreateDto) (*ApiKeyResponseDto, error)
- func (c *Client) CreateOIDCClient(clientCreateDto OidcClientCreateDto) (*OidcClientWithAllowedUserGroupsDto, error)
- func (c *Client) CreateOIDCClientSecret(id string) (string, error)
- func (c *Client) CreateOIDCTokens(clientID, clientSecret, code, grantType, codeVerifier string) (map[string]interface{}, error)
- func (c *Client) CreateOneTimeAccessTokenForCurrentUser(id string, tokenOptions OneTimeAccessTokenCreateDto) (string, error)
- func (c *Client) CreateUser(userCreateDto UserCreateDto) (*UserDto, error)
- func (c *Client) CreateUserGroup(userGroupCreateDto UserGroupCreateDto) (*UserGroupDtoWithUsers, error)
- func (c *Client) DeleteOIDCClient(id string) error
- func (c *Client) DeleteOIDCClientLogo(id string) error
- func (c *Client) DeleteUser(id string) error
- func (c *Client) DeleteUserGroup(id string) error
- func (c *Client) EndOIDCSession(idTokenHint, postLogoutRedirectURI, state string) error
- func (c *Client) EndOIDCSessionPost(idTokenHint, postLogoutRedirectURI, state string) error
- func (c *Client) ExchangeOneTimeAccessToken(token string) (*UserDto, error)
- func (c *Client) GetBackgroundImage() ([]byte, error)
- func (c *Client) GetCurrentUser() (*UserDto, error)
- func (c *Client) GetCurrentUserProfilePicture() ([]byte, error)
- func (c *Client) GetCustomClaimSuggestions() ([]string, error)
- func (c *Client) GetFavicon() ([]byte, error)
- func (c *Client) GetJWKS() (map[string]interface{}, error)
- func (c *Client) GetLogo(isLight bool) ([]byte, error)
- func (c *Client) GetOIDCClient(id string) (*OidcClientWithAllowedUserGroupsDto, error)
- func (c *Client) GetOIDCClientLogo(id string) ([]byte, error)
- func (c *Client) GetOIDCClientMeta(id string) (*OidcClientMetaDataDto, error)
- func (c *Client) GetOpenIDConfiguration() (map[string]interface{}, error)
- func (c *Client) GetUserByID(id string) (*UserDto, error)
- func (c *Client) GetUserGroupByID(id string) (*UserGroupDtoWithUsers, error)
- func (c *Client) GetUserGroups(id string) ([]UserGroupDto, error)
- func (c *Client) GetUserInfo(accessToken string) (map[string]interface{}, error)
- func (c *Client) GetUserInfoPost(accessToken string) (map[string]interface{}, error)
- func (c *Client) GetUserProfilePicture(id string) ([]byte, error)
- func (c *Client) ListAPIKeys(page, limit int, sortColumn, sortDirection string) (*Paginated[ApiKeyDto], error)
- func (c *Client) ListAllAppConfig() ([]AppConfigVariableDto, error)
- func (c *Client) ListAuditLogs(page, limit int, sortColumn, sortDirection string) (*Paginated[AuditLogDto], error)
- func (c *Client) ListOIDCClients(search string, page, limit int, sortColumn, sortDirection string) (*Paginated[OidcClientDto], error)
- func (c *Client) ListPublicAppConfig() ([]PublicAppConfigVariableDto, error)
- func (c *Client) ListUserGroups(search string, page, limit int, sortColumn, sortDirection string) (*Paginated[UserGroupDtoWithUserCount], error)
- func (c *Client) ListUsers(search string, page, limit int, sortColumn, sortDirection string) (*Paginated[UserDto], error)
- func (c *Client) RevokeAPIKey(id string) error
- func (c *Client) SendTestEmail() error
- func (c *Client) SetupInitialAdmin() (*UserDto, error)
- func (c *Client) SyncLDAP() error
- func (c *Client) UpdateAppConfig(config AppConfigUpdateDto) ([]AppConfigVariableDto, error)
- func (c *Client) UpdateBackgroundImage(file io.Reader) error
- func (c *Client) UpdateCurrentUser(userCreateDto UserCreateDto) (*UserDto, error)
- func (c *Client) UpdateCurrentUserProfilePicture(file io.Reader) error
- func (c *Client) UpdateCustomClaimsForUser(userID string, claims []CustomClaimDto) ([]CustomClaimDto, error)
- func (c *Client) UpdateCustomClaimsForUserGroup(userGroupID string, claims []CustomClaimDto) ([]CustomClaimDto, error)
- func (c *Client) UpdateFavicon(file io.Reader) error
- func (c *Client) UpdateLogo(file io.Reader, isLight bool) error
- func (c *Client) UpdateOIDCClient(id string, clientCreateDto OidcClientCreateDto) (*OidcClientWithAllowedUserGroupsDto, error)
- func (c *Client) UpdateOIDCClientAllowedUserGroups(id string, groups OidcUpdateAllowedUserGroupsDto) (*OidcClientDto, error)
- func (c *Client) UpdateOIDCClientLogo(id string, file io.Reader) error
- func (c *Client) UpdateUser(id string, userCreateDto UserCreateDto) (*UserDto, error)
- func (c *Client) UpdateUserGroup(id string, userGroupCreateDto UserGroupCreateDto) (*UserGroupDtoWithUsers, error)
- func (c *Client) UpdateUserGroups(id string, groupDto UserUpdateUserGroupDto) (*UserDto, error)
- func (c *Client) UpdateUserProfilePicture(id string, file io.Reader) error
- func (c *Client) UpdateUsersInGroup(id string, users UserGroupUpdateUsersDto) (*UserGroupDtoWithUsers, error)
- type CustomClaimDto
- type ErrorResponse
- type OidcClientCreateDto
- type OidcClientDto
- type OidcClientMetaDataDto
- type OidcClientWithAllowedUserGroupsDto
- type OidcUpdateAllowedUserGroupsDto
- type OneTimeAccessTokenCreateDto
- type Paginated
- type Pagination
- type PublicAppConfigVariableDto
- type UserCreateDto
- type UserDto
- type UserGroupCreateDto
- type UserGroupDto
- type UserGroupDtoWithUserCount
- type UserGroupDtoWithUsers
- type UserGroupUpdateUsersDto
- type UserUpdateUserGroupDto
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 ¶
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 ¶
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 ¶
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.
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.
func (*Client) CreateOIDCClient ¶
func (c *Client) CreateOIDCClient(clientCreateDto OidcClientCreateDto) (*OidcClientWithAllowedUserGroupsDto, error)
CreateOIDCClient creates a new OIDC client.
func (*Client) CreateOIDCClientSecret ¶
CreateOIDCClientSecret generates a new secret for an OIDC client.
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.
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.
func (*Client) CreateUserGroup ¶
func (c *Client) CreateUserGroup(userGroupCreateDto UserGroupCreateDto) (*UserGroupDtoWithUsers, error)
CreateUserGroup creates a new user group.
func (*Client) DeleteOIDCClient ¶
DeleteOIDCClient deletes an OIDC client by ID.
func (*Client) DeleteOIDCClientLogo ¶
DeleteOIDCClientLogo deletes the logo for an OIDC client.
func (*Client) DeleteUser ¶
DeleteUser deletes a specific user by ID.
func (*Client) DeleteUserGroup ¶
DeleteUserGroup deletes a specific user group by ID.
func (*Client) EndOIDCSession ¶
EndOIDCSession ends the user session and handles OIDC logout.
func (*Client) EndOIDCSessionPost ¶
EndOIDCSessionPost ends the user session and handles OIDC logout using POST.
func (*Client) ExchangeOneTimeAccessToken ¶
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 ¶
GetBackgroundImage gets the background image for the application.
See https://pocket-id.example.com/application-configuration/background-image
func (*Client) GetCurrentUser ¶
GetCurrentUser retrieves information about the currently authenticated user.
func (*Client) GetCurrentUserProfilePicture ¶
GetCurrentUserProfilePicture retrieves the currently authenticated user's profile picture.
See https://pocket-id.example.com/users/me/profile-picture.png
func (*Client) GetCustomClaimSuggestions ¶
GetCustomClaimSuggestions gets a list of suggested custom claim names.
func (*Client) GetFavicon ¶
GetFavicon gets the favicon for the application.
See https://pocket-id.example.com/application-configuration/favicon
func (*Client) GetLogo ¶
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.
func (*Client) GetOIDCClientLogo ¶
GetOIDCClientLogo gets the logo image for an OIDC client.
func (*Client) GetOIDCClientMeta ¶
func (c *Client) GetOIDCClientMeta(id string) (*OidcClientMetaDataDto, error)
GetOIDCClientMeta gets OIDC client metadata for discovery and configuration.
func (*Client) GetOpenIDConfiguration ¶
GetOpenIDConfiguration returns the OpenID Connect discovery document.
See https://pocket-id.example.com/.well-known/openid-configuration
func (*Client) GetUserByID ¶
GetUserByID retrieves detailed information about a specific user.
func (*Client) GetUserGroupByID ¶
func (c *Client) GetUserGroupByID(id string) (*UserGroupDtoWithUsers, error)
GetUserGroupByID retrieves detailed information about a specific user group, including its users.
func (*Client) GetUserGroups ¶
func (c *Client) GetUserGroups(id string) ([]UserGroupDto, error)
GetUserGroups retrieves all groups a specific user belongs to.
func (*Client) GetUserInfo ¶
GetUserInfo gets user information based on the access token.
func (*Client) GetUserInfoPost ¶
GetUserInfoPost gets user information based on the access token using POST. See https://pocket-id.example.com/oidc/userinfo
func (*Client) GetUserProfilePicture ¶
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.
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.
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.
func (*Client) ListPublicAppConfig ¶
func (c *Client) ListPublicAppConfig() ([]PublicAppConfigVariableDto, error)
ListPublicAppConfig gets all public application configurations.
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.
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.
func (*Client) RevokeAPIKey ¶
RevokeAPIKey revokes (deletes) an existing API key by ID.
func (*Client) SendTestEmail ¶
SendTestEmail sends a test email to verify email configuration.
See https://pocket-id.example.com/application-configuration/test-email
func (*Client) SetupInitialAdmin ¶
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 ¶
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.
func (*Client) UpdateBackgroundImage ¶
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.
func (*Client) UpdateCurrentUserProfilePicture ¶
UpdateCurrentUserProfilePicture updates the currently authenticated user's 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 ¶
UpdateFavicon updates the application favicon.
See https://pocket-id.example.com/application-configuration/favicon
func (*Client) UpdateLogo ¶
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.
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 (*Client) UpdateOIDCClientLogo ¶
UpdateOIDCClientLogo uploads or updates the logo for an OIDC client.
func (*Client) UpdateUser ¶
func (c *Client) UpdateUser(id string, userCreateDto UserCreateDto) (*UserDto, error)
UpdateUser updates an existing user by ID.
func (*Client) UpdateUserGroup ¶
func (c *Client) UpdateUserGroup(id string, userGroupCreateDto UserGroupCreateDto) (*UserGroupDtoWithUsers, error)
UpdateUserGroup updates an existing user group by ID.
func (*Client) UpdateUserGroups ¶
func (c *Client) UpdateUserGroups(id string, groupDto UserUpdateUserGroupDto) (*UserDto, error)
UpdateUserGroups updates the groups a specific user belongs to.
func (*Client) UpdateUserProfilePicture ¶
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.
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"`
HasLogo bool `json:"hasLogo"`
}
OidcClientDto represents an OIDC client.
type OidcClientMetaDataDto ¶
type OidcClientMetaDataDto struct {
ID string `json:"id"`
Name string `json:"name"`
HasLogo bool `json:"hasLogo"`
}
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"`
HasLogo bool `json:"hasLogo"`
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.