@@ -113,15 +113,49 @@ type ServerConfig struct {
113113}
114114
115115type AuthConfig struct {
116- IP IPConfig `description:"IP whitelisting config options." yaml:"ip"`
117- Users []string `description:"Comma-separated list of users (username:hashed_password)." yaml:"users"`
118- UsersFile string `description:"Path to the users file." yaml:"usersFile"`
119- SecureCookie bool `description:"Enable secure cookies." yaml:"secureCookie"`
120- SessionExpiry int `description:"Session expiry time in seconds." yaml:"sessionExpiry"`
121- SessionMaxLifetime int `description:"Maximum session lifetime in seconds." yaml:"sessionMaxLifetime"`
122- LoginTimeout int `description:"Login timeout in seconds." yaml:"loginTimeout"`
123- LoginMaxRetries int `description:"Maximum login retries." yaml:"loginMaxRetries"`
124- TrustedProxies []string `description:"Comma-separated list of trusted proxy addresses." yaml:"trustedProxies"`
116+ IP IPConfig `description:"IP whitelisting config options." yaml:"ip"`
117+ Users map [string ]UserConfig `description:"Map of users (username -> user config)." yaml:"users"`
118+ UsersFile string `description:"Path to the users file." yaml:"usersFile"`
119+ SecureCookie bool `description:"Enable secure cookies." yaml:"secureCookie"`
120+ SessionExpiry int `description:"Session expiry time in seconds." yaml:"sessionExpiry"`
121+ SessionMaxLifetime int `description:"Maximum session lifetime in seconds." yaml:"sessionMaxLifetime"`
122+ LoginTimeout int `description:"Login timeout in seconds." yaml:"loginTimeout"`
123+ LoginMaxRetries int `description:"Maximum login retries." yaml:"loginMaxRetries"`
124+ TrustedProxies []string `description:"Comma-separated list of trusted proxy addresses." yaml:"trustedProxies"`
125+ }
126+
127+ type UserConfig struct {
128+ Password string `description:"Bcrypt hashed password." yaml:"password"`
129+ TotpSecret string `description:"TOTP secret for two-factor authentication." yaml:"totpSecret"`
130+ Attributes UserAttributes `description:"Optional user attributes used as OIDC claims." yaml:"attributes"`
131+ }
132+
133+ type UserAttributes struct {
134+ Name string `description:"Full name of the user." yaml:"name"`
135+ GivenName string `description:"Given (first) name of the user." yaml:"givenName"`
136+ FamilyName string `description:"Family (last) name of the user." yaml:"familyName"`
137+ MiddleName string `description:"Middle name of the user." yaml:"middleName"`
138+ Nickname string `description:"Nickname of the user." yaml:"nickname"`
139+ Profile string `description:"URL of the user's profile page." yaml:"profile"`
140+ Picture string `description:"URL of the user's profile picture." yaml:"picture"`
141+ Website string `description:"URL of the user's website." yaml:"website"`
142+ Email string `description:"Email address of the user." yaml:"email"`
143+ Gender string `description:"Gender of the user." yaml:"gender"`
144+ Birthdate string `description:"Birthdate of the user (YYYY-MM-DD)." yaml:"birthdate"`
145+ Zoneinfo string `description:"Time zone of the user (e.g. Europe/Athens)." yaml:"zoneinfo"`
146+ Locale string `description:"Locale of the user (e.g. en-US)." yaml:"locale"`
147+ PhoneNumber string `description:"Phone number of the user." yaml:"phoneNumber"`
148+ PhoneNumberVerified bool `description:"Whether the phone number has been verified." yaml:"phoneNumberVerified"`
149+ Address AddressClaim `description:"Address of the user." yaml:"address"`
150+ }
151+
152+ type AddressClaim struct {
153+ Formatted string `description:"Full mailing address, formatted for display." yaml:"formatted" json:"formatted,omitempty"`
154+ StreetAddress string `description:"Street address." yaml:"streetAddress" json:"street_address,omitempty"`
155+ Locality string `description:"City or locality." yaml:"locality" json:"locality,omitempty"`
156+ Region string `description:"State, province, or region." yaml:"region" json:"region,omitempty"`
157+ PostalCode string `description:"Zip or postal code." yaml:"postalCode" json:"postal_code,omitempty"`
158+ Country string `description:"Country." yaml:"country" json:"country,omitempty"`
125159}
126160
127161type IPConfig struct {
@@ -228,6 +262,7 @@ type User struct {
228262 Username string
229263 Password string
230264 TotpSecret string
265+ Attributes UserAttributes
231266}
232267
233268type LdapUser struct {
@@ -254,6 +289,7 @@ type UserContext struct {
254289 OAuthName string
255290 OAuthSub string
256291 LdapGroups string
292+ Attributes UserAttributes
257293}
258294
259295// API responses and queries
0 commit comments