methods

package
v0.0.0-...-3e41e11 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: AGPL-3.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxCustomersExportLimit = 10000 // Maximum customers to export (DoS protection)
)
View Source
const (
	MaxDistributorsExportLimit = 10000 // Maximum distributors to export (DoS protection)
)
View Source
const (
	MaxExportLimit = 10000 // Maximum systems to export (DoS protection)
)
View Source
const (
	MaxResellersExportLimit = 10000 // Maximum resellers to export (DoS protection)
)
View Source
const (
	MaxUsersExportLimit = 10000 // Maximum users to export (DoS protection)
)

Variables

This section is empty.

Functions

func AssignApplicationOrganization

func AssignApplicationOrganization(c *gin.Context)

AssignApplicationOrganization handles PATCH /api/applications/:id/assign - assigns organization

func ChangeInfo

func ChangeInfo(c *gin.Context)

ChangeInfo allows the current user to change their own personal information POST /me/change-info

func ChangePassword

func ChangePassword(c *gin.Context)

ChangePassword allows the current user to change their own password POST /me/change-password

func CheckSystemReachability

func CheckSystemReachability(c *gin.Context)

CheckSystemReachability handles GET /api/systems/:id/reachability - checks if a system's web UI is reachable

func ConfigureAlerts

func ConfigureAlerts(c *gin.Context)

ConfigureAlerts handles POST /api/alerts/config

func ConfirmCustomersImport

func ConfirmCustomersImport(c *gin.Context)

ConfirmCustomersImport handles POST /api/customers/import/confirm

func ConfirmDistributorsImport

func ConfirmDistributorsImport(c *gin.Context)

ConfirmDistributorsImport handles POST /api/distributors/import/confirm

func ConfirmResellersImport

func ConfirmResellersImport(c *gin.Context)

ConfirmResellersImport handles POST /api/resellers/import/confirm

func ConfirmUsersImport

func ConfirmUsersImport(c *gin.Context)

ConfirmUsersImport handles POST /api/users/import/confirm.

Behavior matrix:

valid     → CREATE
error     → skipped (reason=error)
ambiguous → CREATE with the chosen org if a resolution is provided, otherwise skipped
warning   → UPDATE the existing user (looked up by email) when override=true,
            otherwise skipped

`skip_rows` no longer exists in the request: the backend computes skips automatically.

func CreateCustomer

func CreateCustomer(c *gin.Context)

CreateCustomer handles POST /api/customers - creates a new customer locally and syncs to Logto

func CreateDistributor

func CreateDistributor(c *gin.Context)

CreateDistributor handles POST /api/distributors - creates a new distributor locally and syncs to Logto

func CreateReseller

func CreateReseller(c *gin.Context)

CreateReseller handles POST /api/resellers - creates a new reseller locally and syncs to Logto

func CreateSystem

func CreateSystem(c *gin.Context)

CreateSystem handles POST /api/systems - creates a new system

func CreateSystemAlertSilence

func CreateSystemAlertSilence(c *gin.Context)

CreateSystemAlertSilence handles POST /api/systems/:id/alerts/silences Creates a silence in Alertmanager for a specific active system alert.

func CreateUser

func CreateUser(c *gin.Context)

CreateUser handles POST /api/users - creates a new user locally and syncs to Logto

func DeleteApplication

func DeleteApplication(c *gin.Context)

DeleteApplication handles DELETE /api/applications/:id - soft deletes an application

func DeleteCustomer

func DeleteCustomer(c *gin.Context)

DeleteCustomer handles DELETE /api/customers/:id - soft-deletes a customer locally and syncs to Logto

func DeleteDistributor

func DeleteDistributor(c *gin.Context)

DeleteDistributor handles DELETE /api/distributors/:id - soft-deletes a distributor locally and syncs to Logto

func DeleteMyAvatar

func DeleteMyAvatar(c *gin.Context)

DeleteMyAvatar removes the avatar for the current user. DELETE /api/me/avatar

func DeleteRebrandingAsset

func DeleteRebrandingAsset(c *gin.Context)

DeleteRebrandingAsset deletes a single asset for an org+product

func DeleteRebrandingProduct

func DeleteRebrandingProduct(c *gin.Context)

DeleteRebrandingProduct deletes all rebranding assets for an org+product

func DeleteReseller

func DeleteReseller(c *gin.Context)

DeleteReseller handles DELETE /api/resellers/:id - soft-deletes a reseller locally and syncs to Logto

func DeleteSystem

func DeleteSystem(c *gin.Context)

DeleteSystem handles DELETE /api/systems/:id - deletes a system

func DeleteSystemAlertSilence

func DeleteSystemAlertSilence(c *gin.Context)

DeleteSystemAlertSilence handles DELETE /api/systems/:id/alerts/silences/:silence_id Deletes a system-scoped silence in Alertmanager after validating its ownership.

func DeleteSystemBackup

func DeleteSystemBackup(c *gin.Context)

DeleteSystemBackup handles DELETE /api/systems/:id/backups/:backup_id — removes a backup object from storage. RBAC-gated like the read endpoints.

func DeleteUser

func DeleteUser(c *gin.Context)

DeleteUser handles DELETE /api/users/:id - soft-deletes a user account locally and syncs to Logto

func DeleteUserAvatar

func DeleteUserAvatar(c *gin.Context)

DeleteUserAvatar removes the avatar for another user (admin). DELETE /api/users/:id/avatar

func DestroyCustomer

func DestroyCustomer(c *gin.Context)

DestroyCustomer handles DELETE /api/customers/:id/destroy - permanently deletes a customer

func DestroyDistributor

func DestroyDistributor(c *gin.Context)

DestroyDistributor handles DELETE /api/distributors/:id/destroy - permanently deletes a distributor

func DestroyReseller

func DestroyReseller(c *gin.Context)

DestroyReseller handles DELETE /api/resellers/:id/destroy - permanently deletes a reseller

func DestroySystem

func DestroySystem(c *gin.Context)

DestroySystem handles DELETE /api/systems/:id/destroy - permanently deletes a system

func DestroyUser

func DestroyUser(c *gin.Context)

DestroyUser handles DELETE /api/users/:id/destroy - permanently deletes a user

func DisableAlerts

func DisableAlerts(c *gin.Context)

DisableAlerts handles DELETE /api/alerts/config

func DisableImpersonationConsent

func DisableImpersonationConsent(c *gin.Context)

DisableImpersonationConsent allows a user to disable consent for being impersonated DELETE /api/impersonate/consent

func DisableRebranding

func DisableRebranding(c *gin.Context)

DisableRebranding disables rebranding for an organization (Owner + Admin only)

func DownloadSystemBackup

func DownloadSystemBackup(c *gin.Context)

DownloadSystemBackup handles GET /api/systems/:id/backups/:backup_id/download. It returns 200 with a JSON body containing a short-lived presigned URL so the caller can fetch the object directly from Spaces.

func EnableImpersonationConsent

func EnableImpersonationConsent(c *gin.Context)

EnableImpersonationConsent allows a user to enable consent for being impersonated POST /api/impersonate/consent

func EnableRebranding

func EnableRebranding(c *gin.Context)

EnableRebranding enables rebranding for an organization (Owner + Admin only)

func ExchangeToken

func ExchangeToken(c *gin.Context)

ExchangeToken converts Logto access token to custom JWT POST /auth/exchange

func ExitImpersonationWithAudit

func ExitImpersonationWithAudit(c *gin.Context)

ExitImpersonationWithAudit allows user to exit impersonation mode and logs the session end DELETE /api/impersonate

func ExportCustomers

func ExportCustomers(c *gin.Context)

ExportCustomers handles GET /api/customers/export - exports customers with applied filters

func ExportDistributors

func ExportDistributors(c *gin.Context)

ExportDistributors handles GET /api/distributors/export - exports distributors with applied filters

func ExportResellers

func ExportResellers(c *gin.Context)

ExportResellers handles GET /api/resellers/export - exports resellers with applied filters

func ExportSystems

func ExportSystems(c *gin.Context)

ExportSystems handles GET /api/systems/export - exports systems with applied filters

func ExportUsers

func ExportUsers(c *gin.Context)

ExportUsers handles GET /api/users/export - exports users with applied filters

func FetchFilteredRoles

func FetchFilteredRoles(user *models.User) ([]models.Role, error)

FetchFilteredRoles returns user roles filtered by access control. Extracted for reuse by the aggregated users filters endpoint.

func GetAlertingConfig

func GetAlertingConfig(c *gin.Context)

GetAlertingConfig handles GET /api/alerts/config By default returns structured JSON parsed from Mimir YAML. Use ?format=yaml to get the raw (redacted) YAML.

func GetAlerts

func GetAlerts(c *gin.Context)

GetAlerts handles GET /api/alerts

Lists active alerts. Scope follows the same three modes as /alerts/totals:

  • no organization_id → caller's full hierarchy (cross-tenant fan-out)
  • organization_id=X → single tenant X
  • organization_id=X & include=descendants → X plus its sub-tree

Customer callers are always pinned to their own organization.

Response contains the paginated slice plus a `pagination` object and a `warnings` array (always present, populated only when one or more tenants failed during fan-out — the rest of the result is still returned).

func GetAlertsHistory

func GetAlertsHistory(c *gin.Context)

GetAlertsHistory handles GET /api/alerts/history Returns paginated resolved alert history scoped to the caller's hierarchy (no organization_id), a single tenant (organization_id=X), or a sub-tree (organization_id=X&include=descendants). Mirrors the scope rules of /api/alerts/totals. Supports date range and multi-value label filters.

func GetAlertsStats

func GetAlertsStats(c *gin.Context)

GetAlertsStats handles GET /api/alerts/stats Returns aggregate statistics over alert_history for the caller's scope: total, by_severity buckets, top-N alertname / system_key, plus MTTR and MTBF approximations. Honors the same scope rules as /alerts/totals (no organization_id / single tenant / descendants drill-down) and accepts an optional date range (from_date / to_date, RFC3339).

func GetAlertsTotals

func GetAlertsTotals(c *gin.Context)

GetAlertsTotals handles GET /api/alerts/totals Returns active alert counts by severity (from Mimir) and total history count (from DB).

Without organization_id the totals are aggregated across the caller's full hierarchy (one Mimir call per tenant, fanned out with bounded concurrency and a global timeout). With organization_id the call is scoped to that single tenant.

func GetAlertsTrend

func GetAlertsTrend(c *gin.Context)

GetAlertsTrend handles GET /api/alerts/trend Returns trend data for resolved alerts over a specified period, scoped to the caller's hierarchy (no organization_id), a specific tenant, or a sub-tree (organization_id=X&include=descendants). Mirrors the scope rules of /api/alerts/totals.

func GetApplication

func GetApplication(c *gin.Context)

GetApplication handles GET /api/applications/:id - retrieves a single application

func GetApplicationFilters

func GetApplicationFilters(c *gin.Context)

GetApplicationFilters handles GET /api/filters/applications - aggregated filters endpoint Returns types, versions, systems, and organizations in a single response. Single RBAC resolution, parallel data fetching.

func GetApplicationTotals

func GetApplicationTotals(c *gin.Context)

GetApplicationTotals handles GET /api/applications/totals - returns statistics

func GetApplicationTypeSummary

func GetApplicationTypeSummary(c *gin.Context)

GetApplicationTypeSummary handles GET /api/applications/summary - returns applications grouped by type

func GetApplications

func GetApplications(c *gin.Context)

GetApplications handles GET /api/applications - retrieves all applications with pagination

func GetApplicationsTrend

func GetApplicationsTrend(c *gin.Context)

GetApplicationsTrend returns trend data for applications over a specified period

func GetCurrentUser

func GetCurrentUser(c *gin.Context)

GetCurrentUser returns current user information from JWT token GET /me

func GetCustomer

func GetCustomer(c *gin.Context)

GetCustomer handles GET /api/customers/:id - retrieves a single customer

func GetCustomerStats

func GetCustomerStats(c *gin.Context)

GetCustomerStats handles GET /api/customers/:id/stats - retrieves users, systems and applications count for a customer

func GetCustomers

func GetCustomers(c *gin.Context)

GetCustomers handles GET /api/customers - list customers with pagination

func GetCustomersImportTemplate

func GetCustomersImportTemplate(c *gin.Context)

GetCustomersImportTemplate handles GET /api/customers/import/template

func GetCustomersTotals

func GetCustomersTotals(c *gin.Context)

GetCustomersTotals returns the total count of customers accessible to the user

func GetCustomersTrend

func GetCustomersTrend(c *gin.Context)

GetCustomersTrend returns trend data for customers over a specified period

func GetDistributor

func GetDistributor(c *gin.Context)

GetDistributor handles GET /api/distributors/:id - retrieves a single distributor

func GetDistributorStats

func GetDistributorStats(c *gin.Context)

GetDistributorStats handles GET /api/distributors/:id/stats - retrieves users and systems count for a distributor

func GetDistributors

func GetDistributors(c *gin.Context)

GetDistributors handles GET /api/distributors - list distributors with pagination

func GetDistributorsImportTemplate

func GetDistributorsImportTemplate(c *gin.Context)

GetDistributorsImportTemplate handles GET /api/distributors/import/template

func GetDistributorsTotals

func GetDistributorsTotals(c *gin.Context)

GetDistributorsTotals returns the total count of distributors accessible to the user

func GetDistributorsTrend

func GetDistributorsTrend(c *gin.Context)

GetDistributorsTrend returns trend data for distributors over a specified period

func GetImpersonationConsentStatus

func GetImpersonationConsentStatus(c *gin.Context)

GetImpersonationConsentStatus gets the current consent status for the user GET /api/impersonate/consent

func GetImpersonationSession

func GetImpersonationSession(c *gin.Context)

GetImpersonationSession retrieves details for a specific impersonation session GET /api/impersonate/sessions/:session_id

func GetImpersonationSessions

func GetImpersonationSessions(c *gin.Context)

GetImpersonationSessions retrieves all impersonation sessions for current user GET /api/impersonate/sessions

func GetImpersonationStatus

func GetImpersonationStatus(c *gin.Context)

GetImpersonationStatus checks if user is currently impersonating and returns session info GET /api/impersonate/status

func GetOrganizationRoles

func GetOrganizationRoles(c *gin.Context)

GetOrganizationRoles returns all available organization roles

func GetOrganizations

func GetOrganizations(c *gin.Context)

GetOrganizations returns organizations the current user can assign users to with pagination and search

func GetPublicAvatar

func GetPublicAvatar(c *gin.Context)

GetPublicAvatar serves a user's avatar image without authentication. GET /api/public/users/:id/avatar

func GetRebrandingAsset

func GetRebrandingAsset(c *gin.Context)

GetRebrandingAsset serves a single asset binary for an org+product (authenticated via JWT)

func GetRebrandingOrgProducts

func GetRebrandingOrgProducts(c *gin.Context)

GetRebrandingOrgProducts returns rebranding products configuration for an organization

func GetRebrandingProducts

func GetRebrandingProducts(c *gin.Context)

GetRebrandingProducts returns all rebrandable products

func GetRebrandingStatus

func GetRebrandingStatus(c *gin.Context)

GetRebrandingStatus returns the rebranding status for an organization

func GetReseller

func GetReseller(c *gin.Context)

GetReseller handles GET /api/resellers/:id - retrieves a single reseller

func GetResellerStats

func GetResellerStats(c *gin.Context)

GetResellerStats handles GET /api/resellers/:id/stats - retrieves users and systems count for a reseller

func GetResellers

func GetResellers(c *gin.Context)

GetResellers handles GET /api/resellers - list resellers with pagination

func GetResellersImportTemplate

func GetResellersImportTemplate(c *gin.Context)

GetResellersImportTemplate handles GET /api/resellers/import/template

func GetResellersTotals

func GetResellersTotals(c *gin.Context)

GetResellersTotals returns the total count of resellers accessible to the user

func GetResellersTrend

func GetResellersTrend(c *gin.Context)

GetResellersTrend returns trend data for resellers over a specified period

func GetRoles

func GetRoles(c *gin.Context)

GetRoles returns all available user roles filtered by access control

func GetSessionAudit

func GetSessionAudit(c *gin.Context)

GetSessionAudit retrieves audit history for a specific impersonation session GET /api/impersonate/sessions/:session_id/audit

func GetSystem

func GetSystem(c *gin.Context)

GetSystem handles GET /api/systems/:id - retrieves a single system

func GetSystemAlertHistory

func GetSystemAlertHistory(c *gin.Context)

GetSystemAlertHistory handles GET /api/systems/:id/alerts/history Returns paginated resolved/inactive alert history for a system, with optional date range (?from_date=, ?to_date=, RFC3339) and multi-value label filters (alertname, severity, status).

func GetSystemAlertSilence

func GetSystemAlertSilence(c *gin.Context)

GetSystemAlertSilence handles GET /api/systems/:id/alerts/silences/:silence_id Returns a single silence after validating it belongs to this system.

func GetSystemAlertSilences

func GetSystemAlertSilences(c *gin.Context)

GetSystemAlertSilences handles GET /api/systems/:id/alerts/silences Returns all active and pending silences in Alertmanager that are scoped to this system.

func GetSystemAlerts

func GetSystemAlerts(c *gin.Context)

GetSystemAlerts handles GET /api/systems/:id/alerts Returns active alerts from Mimir for a specific system, filtered by system_key.

func GetSystemBackups

func GetSystemBackups(c *gin.Context)

GetSystemBackups handles GET /api/systems/:id/backups — returns the list of backups stored for the given system, enriched with size, checksum, and uploader metadata. Access is gated by the same RBAC rules as GetSystem.

func GetSystemFilters

func GetSystemFilters(c *gin.Context)

GetSystemFilters handles GET /api/filters/systems - aggregated filters endpoint Returns products, created_by, versions, and organizations in a single response. Single auth check, parallel data fetching.

func GetSystemInventoryByID

func GetSystemInventoryByID(c *gin.Context)

GetSystemInventoryByID handles GET /api/systems/:id/inventory/:inventory_id - retrieves a specific inventory record

func GetSystemInventoryChanges

func GetSystemInventoryChanges(c *gin.Context)

GetSystemInventoryChanges handles GET /api/systems/:id/inventory/changes - retrieves changes summary

func GetSystemInventoryDiffs

func GetSystemInventoryDiffs(c *gin.Context)

GetSystemInventoryDiffs handles GET /api/systems/:id/inventory/diffs - retrieves paginated diffs

func GetSystemInventoryHistory

func GetSystemInventoryHistory(c *gin.Context)

GetSystemInventoryHistory handles GET /api/systems/:id/inventory - retrieves paginated inventory history

func GetSystemInventoryTimeline

func GetSystemInventoryTimeline(c *gin.Context)

GetSystemInventoryTimeline handles GET /api/systems/:id/inventory/timeline - retrieves date-grouped timeline

func GetSystemLatestInventory

func GetSystemLatestInventory(c *gin.Context)

GetSystemLatestInventory handles GET /api/systems/:id/inventory/latest - retrieves latest inventory

func GetSystemLatestInventoryChanges

func GetSystemLatestInventoryChanges(c *gin.Context)

GetSystemLatestInventoryChanges handles GET /api/systems/:id/inventory/changes/latest - retrieves latest batch changes summary

func GetSystemLatestInventoryDiff

func GetSystemLatestInventoryDiff(c *gin.Context)

GetSystemLatestInventoryDiff handles GET /api/systems/:id/inventory/diffs/latest - retrieves latest diffs batch

func GetSystems

func GetSystems(c *gin.Context)

GetSystems handles GET /api/systems - retrieves all systems with pagination

func GetSystemsTotals

func GetSystemsTotals(c *gin.Context)

GetSystemsTotals returns the total count of systems and their liveness status based on heartbeat data Respects RBAC hierarchy - users only see totals for systems they can access

func GetSystemsTrend

func GetSystemsTrend(c *gin.Context)

GetSystemsTrend returns trend data for systems over a specified period

func GetThirdPartyApplications

func GetThirdPartyApplications(c *gin.Context)

GetThirdPartyApplications handles GET /api/third-party-applications Returns third-party applications filtered by user access permissions

func GetUser

func GetUser(c *gin.Context)

GetUser handles GET /api/users/:id - retrieves a single user account

func GetUserFilters

func GetUserFilters(c *gin.Context)

GetUserFilters handles GET /api/filters/users - aggregated filters endpoint Returns roles and organizations in a single response. Single auth check, parallel data fetching.

func GetUserPermissions

func GetUserPermissions(c *gin.Context)

GetUserPermissions returns user permissions and role information

func GetUserProfile

func GetUserProfile(c *gin.Context)

GetUserProfile returns complete user profile with business context

func GetUsers

func GetUsers(c *gin.Context)

GetUsers handles GET /api/users - list accounts with pagination

func GetUsersImportTemplate

func GetUsersImportTemplate(c *gin.Context)

GetUsersImportTemplate handles GET /api/users/import/template

func GetUsersTotals

func GetUsersTotals(c *gin.Context)

GetUsersTotals returns the total count of user accounts accessible to the user

func GetUsersTrend

func GetUsersTrend(c *gin.Context)

GetUsersTrend returns trend data for users over a specified period

func HasOrgRolePermission

func HasOrgRolePermission(userOrgRole, requiredOrgRole string) bool

HasOrgRolePermission checks if userOrgRole has permission to access requiredOrgRole Following the business hierarchy: Owner > Distributor > Reseller > Customer

func HasPermission

func HasPermission(userPermissions, orgPermissions []string, permission string) bool

HasPermission checks if a permission exists in either user permissions or org permissions arrays

func ImpersonateUserWithConsent

func ImpersonateUserWithConsent(c *gin.Context)

ImpersonateUserWithConsent allows owner users to impersonate another user (only if consent is active) POST /api/impersonate

func Logout

func Logout(c *gin.Context)

Logout invalidates the current JWT token by adding it to the blacklist POST /api/auth/logout

func ReactivateCustomer

func ReactivateCustomer(c *gin.Context)

ReactivateCustomer handles PATCH /api/customers/:id/reactivate - reactivates a customer and its cascade-suspended users

func ReactivateDistributor

func ReactivateDistributor(c *gin.Context)

ReactivateDistributor handles PATCH /api/distributors/:id/reactivate - reactivates a distributor and its cascade-suspended users

func ReactivateReseller

func ReactivateReseller(c *gin.Context)

ReactivateReseller handles PATCH /api/resellers/:id/reactivate - reactivates a reseller and its cascade-suspended users

func ReactivateSystem

func ReactivateSystem(c *gin.Context)

ReactivateSystem handles PATCH /api/systems/:id/reactivate - reactivates a suspended system

func ReactivateUser

func ReactivateUser(c *gin.Context)

ReactivateUser handles PATCH /api/users/:id/reactivate - reactivates a suspended user

func RefreshToken

func RefreshToken(c *gin.Context)

RefreshToken refreshes access token using refresh token POST /auth/refresh

func RegenerateSystemSecret

func RegenerateSystemSecret(c *gin.Context)

RegenerateSystemSecret handles POST /api/systems/:id/regenerate-secret - regenerates system secret

func RegisterSystem

func RegisterSystem(c *gin.Context)

RegisterSystem handles POST /api/systems/register - registers a system using system_secret

func ResetUserPassword

func ResetUserPassword(c *gin.Context)

ResetUserPassword handles PATCH /api/users/:id/password - resets user password

func RestoreCustomer

func RestoreCustomer(c *gin.Context)

RestoreCustomer handles PATCH /api/customers/:id/restore - restores a soft-deleted customer

func RestoreDistributor

func RestoreDistributor(c *gin.Context)

RestoreDistributor handles PATCH /api/distributors/:id/restore - restores a soft-deleted distributor

func RestoreReseller

func RestoreReseller(c *gin.Context)

RestoreReseller handles PATCH /api/resellers/:id/restore - restores a soft-deleted reseller

func RestoreSystem

func RestoreSystem(c *gin.Context)

RestoreSystem handles PATCH /api/systems/:id/restore - restores a soft-deleted system

func RestoreUser

func RestoreUser(c *gin.Context)

RestoreUser handles PATCH /api/users/:id/restore - restores a soft-deleted user

func SuspendCustomer

func SuspendCustomer(c *gin.Context)

SuspendCustomer handles PATCH /api/customers/:id/suspend - suspends a customer and all its users

func SuspendDistributor

func SuspendDistributor(c *gin.Context)

SuspendDistributor handles PATCH /api/distributors/:id/suspend - suspends a distributor and all its users

func SuspendReseller

func SuspendReseller(c *gin.Context)

SuspendReseller handles PATCH /api/resellers/:id/suspend - suspends a reseller and all its users

func SuspendSystem

func SuspendSystem(c *gin.Context)

SuspendSystem handles PATCH /api/systems/:id/suspend - suspends a system

func SuspendUser

func SuspendUser(c *gin.Context)

SuspendUser handles PATCH /api/users/:id/suspend - suspends a user

func UnassignApplicationOrganization

func UnassignApplicationOrganization(c *gin.Context)

UnassignApplicationOrganization handles PATCH /api/applications/:id/unassign - removes organization

func UpdateApplication

func UpdateApplication(c *gin.Context)

UpdateApplication handles PUT /api/applications/:id - updates an application

func UpdateCustomer

func UpdateCustomer(c *gin.Context)

UpdateCustomer handles PUT /api/customers/:id - updates a customer locally and syncs to Logto

func UpdateDistributor

func UpdateDistributor(c *gin.Context)

UpdateDistributor handles PUT /api/distributors/:id - updates a distributor locally and syncs to Logto

func UpdateReseller

func UpdateReseller(c *gin.Context)

UpdateReseller handles PUT /api/resellers/:id - updates a reseller locally and syncs to Logto

func UpdateSystem

func UpdateSystem(c *gin.Context)

UpdateSystem handles PUT /api/systems/:id - updates an existing system

func UpdateSystemAlertSilence

func UpdateSystemAlertSilence(c *gin.Context)

UpdateSystemAlertSilence handles PUT /api/systems/:id/alerts/silences/:silence_id Updates the end time and/or comment of an existing silence. Preserves the original matchers and start time; only end time and comment change.

func UpdateUser

func UpdateUser(c *gin.Context)

UpdateUser handles PUT /api/users/:id - updates a user account locally and syncs to Logto

func UploadMyAvatar

func UploadMyAvatar(c *gin.Context)

UploadMyAvatar handles avatar upload for the current user. PUT /api/me/avatar

func UploadRebrandingAssets

func UploadRebrandingAssets(c *gin.Context)

UploadRebrandingAssets handles multipart upload of rebranding assets for an org+product

func UploadUserAvatar

func UploadUserAvatar(c *gin.Context)

UploadUserAvatar handles avatar upload for another user (admin). PUT /api/users/:id/avatar

func ValidateCustomersImport

func ValidateCustomersImport(c *gin.Context)

ValidateCustomersImport handles POST /api/customers/import/validate

func ValidateDistributorsImport

func ValidateDistributorsImport(c *gin.Context)

ValidateDistributorsImport handles POST /api/distributors/import/validate

func ValidateResellersImport

func ValidateResellersImport(c *gin.Context)

ValidateResellersImport handles POST /api/resellers/import/validate

func ValidateUsersImport

func ValidateUsersImport(c *gin.Context)

ValidateUsersImport handles POST /api/users/import/validate

Types

type BackupListResponse

type BackupListResponse struct {
	Backups        []BackupMetadata `json:"backups"`
	QuotaUsedBytes int64            `json:"quota_used_bytes"`
	SlotsUsed      int              `json:"slots_used"`
}

BackupListResponse wraps the list of backups with aggregate usage counters (useful for rendering quota/slot indicators in the UI).

type BackupMetadata

type BackupMetadata struct {
	ID         string    `json:"id"`
	Filename   string    `json:"filename"`
	Size       int64     `json:"size"`
	SHA256     string    `json:"sha256"`
	MimeType   string    `json:"mimetype"`
	UploadedAt time.Time `json:"uploaded_at"`
}

BackupMetadata is the JSON payload returned in list responses for a single backup object. The uploader IP is intentionally not exposed: on traffic that transits the translation proxy the stored value is the proxy's IP (not the appliance's), and where it is accurate it would still be a reconnaissance aid for any admin above the customer tier.

type ImpersonateRequest

type ImpersonateRequest struct {
	UserID string `json:"user_id" binding:"required"`
}

ImpersonateRequest represents the request body for user impersonation

type RefreshTokenRequest

type RefreshTokenRequest struct {
	RefreshToken string `json:"refresh_token" binding:"required"`
}

RefreshTokenRequest represents the request body for token refresh

type TokenExchangeRequest

type TokenExchangeRequest struct {
	AccessToken string `json:"access_token" binding:"required"`
}

TokenExchangeRequest represents the request body for token exchange

type TokenExchangeResponse

type TokenExchangeResponse struct {
	Token        string      `json:"token"`
	RefreshToken string      `json:"refresh_token"`
	ExpiresIn    int64       `json:"expires_in"`
	User         models.User `json:"user"`
}

TokenExchangeResponse represents the response for token exchange

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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