templates

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderTempl

func RenderTempl(c *gin.Context, status int, component templ.Component)

RenderTempl renders a templ component to a Gin context

Types

type AuditLogsPageProps

type AuditLogsPageProps struct {
	BaseProps
	NavbarProps
	User        *models.User
	Logs        []*models.AuditLog
	TotalItems  int
	Page        int
	TotalPages  int
	NextPage    int
	PrevPage    int
	PageSize    int
	Search      string
	EventType   string
	Severity    string
	Success     string
	ActorIP     string
	QueryString string
}

AuditLogsPageProps contains properties for the audit logs page

type AuthorizationDisplay

type AuthorizationDisplay struct {
	UUID       string
	ClientID   string
	ClientName string
	Scopes     string
	GrantedAt  time.Time
	IsActive   bool
}

AuthorizationDisplay is a view model for a single user authorization entry

type AuthorizationsPageProps

type AuthorizationsPageProps struct {
	BaseProps
	NavbarProps
	Authorizations []AuthorizationDisplay
	Success        string
	Error          string
}

AuthorizationsPageProps contains properties for the account authorizations page

type AuthorizePageProps

type AuthorizePageProps struct {
	BaseProps
	NavbarProps
	Username            string
	ClientID            string
	ClientName          string
	ClientDescription   string
	RedirectURI         string
	Scopes              string   // Space-separated scope string
	ScopeList           []string // Pre-split scope list for template iteration
	State               string
	Nonce               string
	CodeChallenge       string
	CodeChallengeMethod string
	Error               string
}

AuthorizePageProps contains properties for the OAuth consent page

type BaseProps

type BaseProps struct {
	CSRFToken string
}

BaseProps contains common properties shared across all pages

type ClientAuthorizationDisplay

type ClientAuthorizationDisplay struct {
	UUID      string
	UserID    string
	Username  string
	Email     string
	Scopes    string
	GrantedAt time.Time
}

ClientAuthorizationDisplay is a view model for one user's grant on the admin overview page

type ClientAuthorizationsPageProps

type ClientAuthorizationsPageProps struct {
	BaseProps
	NavbarProps
	Client         *models.OAuthApplication
	Authorizations []ClientAuthorizationDisplay
	Error          string
}

ClientAuthorizationsPageProps contains properties for the admin client-authorizations page

type ClientCreatedPageProps

type ClientCreatedPageProps struct {
	BaseProps
	NavbarProps
	Client       *ClientDisplay
	ClientSecret string
}

ClientCreatedPageProps contains properties for the client created page

type ClientDetailPageProps

type ClientDetailPageProps struct {
	BaseProps
	NavbarProps
	Client           *models.OAuthApplication
	ActiveTokenCount int64 // Number of active tokens for this client
	Success          string
	Error            string
}

ClientDetailPageProps contains properties for the client detail page

type ClientDisplay

type ClientDisplay struct {
	ID                          int64
	ClientID                    string
	ClientName                  string
	Description                 string
	Scopes                      string
	GrantTypes                  string
	RedirectURIs                string // Comma-separated string
	ClientType                  string // "confidential" or "public"
	EnableDeviceFlow            bool
	EnableAuthCodeFlow          bool
	EnableClientCredentialsFlow bool
	IsActive                    bool
	CreatedAt                   time.Time
	UpdatedAt                   time.Time
}

ClientDisplay wraps OAuthApplication with string fields for template rendering

type ClientFormPageProps

type ClientFormPageProps struct {
	BaseProps
	NavbarProps
	Client *ClientDisplay
	Error  string
	IsEdit bool
	Title  string
	Method string
	Action string
}

ClientFormPageProps contains properties for the client form page

type ClientSecretPageProps

type ClientSecretPageProps struct {
	BaseProps
	NavbarProps
	Client       *models.OAuthApplication
	ClientSecret string
}

ClientSecretPageProps contains properties for the client secret page

type ClientsPageProps

type ClientsPageProps struct {
	BaseProps
	NavbarProps
	User       *models.User
	Clients    []services.ClientWithCreator
	Pagination store.PaginationResult
	Search     string
	PageSize   int
	Success    string
}

ClientsPageProps contains properties for the admin clients page

type DevicePageProps

type DevicePageProps struct {
	BaseProps
	NavbarProps
	Username   string
	UserCode   string
	ClientName string
	Error      string
}

DevicePageProps contains properties for the device authorization page

type ErrorPageProps

type ErrorPageProps struct {
	BaseProps
	Error   string
	Message string
}

ErrorPageProps contains properties for the error page

type LoginPageProps

type LoginPageProps struct {
	BaseProps
	NavbarProps
	Error          string
	Redirect       string
	OAuthProviders []OAuthProvider
}

LoginPageProps contains properties for the login page

type NavbarProps struct {
	Username   string
	IsAdmin    bool
	ActiveLink string // "device", "sessions", "clients", "audit"
}

NavbarProps contains properties for the navigation bar

type OAuthProvider

type OAuthProvider struct {
	Name        string
	DisplayName string
}

OAuthProvider represents an OAuth provider configuration

type PaginationProps

type PaginationProps struct {
	Pagination  store.PaginationResult
	BaseURL     string
	QueryParams map[string]string
}

PaginationProps contains properties for pagination component

type SessionsPageProps

type SessionsPageProps struct {
	BaseProps
	NavbarProps
	Sessions   []services.TokenWithClient
	Pagination store.PaginationResult
	Search     string
	PageSize   int
}

SessionsPageProps contains properties for the sessions page

type SuccessPageProps

type SuccessPageProps struct {
	BaseProps
	Username   string
	ClientName string
}

SuccessPageProps contains properties for the success page

Jump to

Keyboard shortcuts

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