add: implement shortlink

This commit is contained in:
mario
2025-05-13 15:44:11 +07:00
parent 2687a761cc
commit dd784da232
8 changed files with 565 additions and 1 deletions

View File

@@ -33,6 +33,12 @@ type Config struct {
EnableDatabaseAuth bool `mapstructure:"enable_database_auth"`
} `mapstructure:"auth"`
Shortlink struct {
BaseURL string `mapstructure:"base_url"` // Base URL for shortlinks (e.g., https://example.com)
DefaultExpiryHours int `mapstructure:"default_expiry_hours"` // Default expiry time in hours
MaxAttempts int `mapstructure:"max_attempts"` // Maximum failed attempts allowed
} `mapstructure:"shortlink"`
Database struct {
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`

View File

@@ -19,6 +19,11 @@ auth:
refresh_token_expiry: 168 # hours (7 days)
enable_database_auth: false # Set to true when ready to use database
shortlink:
base_url: "http://localhost:3333" # The base URL for generated OHIF Auth shortlinks
default_expiry_hours: 24 # Default expiry time for shortlinks (1 day)
max_attempts: 5 # Maximum number of failed login attempts
database:
host: "localhost"
port: 3306