mirror of
				https://github.com/steveiliop56/tinyauth.git
				synced 2025-11-03 23:55:44 +00:00 
			
		
		
		
	Compare commits
	
		
			11 Commits
		
	
	
		
			2ea921f3ca
			...
			refactor/a
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					59e997da26 | ||
| 
						 | 
					9014be90aa | ||
| 
						 | 
					f978ae155a | ||
| 
						 | 
					0227af6d2b | ||
| 
						 | 
					c5bb389258 | ||
| 
						 | 
					6647c6cd78 | ||
| 
						 | 
					7231efcbc3 | ||
| 
						 | 
					5482430907 | ||
| 
						 | 
					97639ae903 | ||
| 
						 | 
					82350594c1 | ||
| 
						 | 
					57b7b66813 | 
							
								
								
									
										5
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							@@ -360,7 +360,6 @@ jobs:
 | 
				
			|||||||
        with:
 | 
					        with:
 | 
				
			||||||
          images: ghcr.io/${{ github.repository_owner }}/tinyauth
 | 
					          images: ghcr.io/${{ github.repository_owner }}/tinyauth
 | 
				
			||||||
          flavor: |
 | 
					          flavor: |
 | 
				
			||||||
            latest=true
 | 
					 | 
				
			||||||
            prefix=v,onlatest=false
 | 
					            prefix=v,onlatest=false
 | 
				
			||||||
          tags: |
 | 
					          tags: |
 | 
				
			||||||
            type=semver,pattern={{version}}
 | 
					            type=semver,pattern={{version}}
 | 
				
			||||||
@@ -403,8 +402,8 @@ jobs:
 | 
				
			|||||||
          images: ghcr.io/${{ github.repository_owner }}/tinyauth
 | 
					          images: ghcr.io/${{ github.repository_owner }}/tinyauth
 | 
				
			||||||
          flavor: |
 | 
					          flavor: |
 | 
				
			||||||
            latest=false
 | 
					            latest=false
 | 
				
			||||||
            prefix=v,onlatest=false
 | 
					            prefix=v
 | 
				
			||||||
            suffix=-distroless,onlatest=false
 | 
					            suffix=-distroless
 | 
				
			||||||
          tags: |
 | 
					          tags: |
 | 
				
			||||||
            type=semver,pattern={{version}}
 | 
					            type=semver,pattern={{version}}
 | 
				
			||||||
            type=semver,pattern={{major}}
 | 
					            type=semver,pattern={{major}}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										19
									
								
								cmd/root.go
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								cmd/root.go
									
									
									
									
									
								
							@@ -1,6 +1,7 @@
 | 
				
			|||||||
package cmd
 | 
					package cmd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"os"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"tinyauth/internal/bootstrap"
 | 
						"tinyauth/internal/bootstrap"
 | 
				
			||||||
	"tinyauth/internal/config"
 | 
						"tinyauth/internal/config"
 | 
				
			||||||
@@ -14,15 +15,16 @@ import (
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type rootCmd struct {
 | 
					type rootCmd struct {
 | 
				
			||||||
	root *cobra.Command
 | 
						root     *cobra.Command
 | 
				
			||||||
	cmd  *cobra.Command
 | 
						cmd      *cobra.Command
 | 
				
			||||||
 | 
						viper    *viper.Viper
 | 
				
			||||||
	viper *viper.Viper
 | 
						aclFlags map[string]string
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func newRootCmd() *rootCmd {
 | 
					func newRootCmd() *rootCmd {
 | 
				
			||||||
	return &rootCmd{
 | 
						return &rootCmd{
 | 
				
			||||||
		viper: viper.New(),
 | 
							viper:    viper.New(),
 | 
				
			||||||
 | 
							aclFlags: make(map[string]string),
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -32,6 +34,9 @@ func (c *rootCmd) Register() {
 | 
				
			|||||||
		Short: "The simplest way to protect your apps with a login screen",
 | 
							Short: "The simplest way to protect your apps with a login screen",
 | 
				
			||||||
		Long:  `Tinyauth is a simple authentication middleware that adds a simple login screen or OAuth with Google, Github or any other provider to all of your docker apps.`,
 | 
							Long:  `Tinyauth is a simple authentication middleware that adds a simple login screen or OAuth with Google, Github or any other provider to all of your docker apps.`,
 | 
				
			||||||
		Run:   c.run,
 | 
							Run:   c.run,
 | 
				
			||||||
 | 
							FParseErrWhitelist: cobra.FParseErrWhitelist{
 | 
				
			||||||
 | 
								UnknownFlags: true,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	c.viper.AutomaticEnv()
 | 
						c.viper.AutomaticEnv()
 | 
				
			||||||
@@ -116,7 +121,7 @@ func (c *rootCmd) run(cmd *cobra.Command, args []string) {
 | 
				
			|||||||
		log.Warn().Msg("Log level set to trace, this will log sensitive information!")
 | 
							log.Warn().Msg("Log level set to trace, this will log sensitive information!")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	app := bootstrap.NewBootstrapApp(conf)
 | 
						app := bootstrap.NewBootstrapApp(conf, c.aclFlags)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = app.Setup()
 | 
						err = app.Setup()
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
@@ -126,6 +131,8 @@ func (c *rootCmd) run(cmd *cobra.Command, args []string) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func Run() {
 | 
					func Run() {
 | 
				
			||||||
	rootCmd := newRootCmd()
 | 
						rootCmd := newRootCmd()
 | 
				
			||||||
 | 
						rootCmd.aclFlags = utils.ExtractACLFlags(os.Args[1:])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	rootCmd.Register()
 | 
						rootCmd.Register()
 | 
				
			||||||
	root := rootCmd.GetCmd()
 | 
						root := rootCmd.GetCmd()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,7 @@
 | 
				
			|||||||
        "@radix-ui/react-separator": "^1.1.7",
 | 
					        "@radix-ui/react-separator": "^1.1.7",
 | 
				
			||||||
        "@radix-ui/react-slot": "^1.2.3",
 | 
					        "@radix-ui/react-slot": "^1.2.3",
 | 
				
			||||||
        "@tailwindcss/vite": "^4.1.14",
 | 
					        "@tailwindcss/vite": "^4.1.14",
 | 
				
			||||||
        "@tanstack/react-query": "^5.90.2",
 | 
					        "@tanstack/react-query": "^5.90.3",
 | 
				
			||||||
        "axios": "^1.12.2",
 | 
					        "axios": "^1.12.2",
 | 
				
			||||||
        "class-variance-authority": "^0.7.1",
 | 
					        "class-variance-authority": "^0.7.1",
 | 
				
			||||||
        "clsx": "^2.1.1",
 | 
					        "clsx": "^2.1.1",
 | 
				
			||||||
@@ -23,7 +23,7 @@
 | 
				
			|||||||
        "react": "^19.2.0",
 | 
					        "react": "^19.2.0",
 | 
				
			||||||
        "react-dom": "^19.2.0",
 | 
					        "react-dom": "^19.2.0",
 | 
				
			||||||
        "react-hook-form": "^7.65.0",
 | 
					        "react-hook-form": "^7.65.0",
 | 
				
			||||||
        "react-i18next": "^16.0.0",
 | 
					        "react-i18next": "^16.0.1",
 | 
				
			||||||
        "react-markdown": "^10.1.0",
 | 
					        "react-markdown": "^10.1.0",
 | 
				
			||||||
        "react-router": "^7.9.4",
 | 
					        "react-router": "^7.9.4",
 | 
				
			||||||
        "sonner": "^2.0.7",
 | 
					        "sonner": "^2.0.7",
 | 
				
			||||||
@@ -36,7 +36,7 @@
 | 
				
			|||||||
        "@tanstack/eslint-plugin-query": "^5.91.0",
 | 
					        "@tanstack/eslint-plugin-query": "^5.91.0",
 | 
				
			||||||
        "@types/node": "^24.7.2",
 | 
					        "@types/node": "^24.7.2",
 | 
				
			||||||
        "@types/react": "^19.2.2",
 | 
					        "@types/react": "^19.2.2",
 | 
				
			||||||
        "@types/react-dom": "^19.2.1",
 | 
					        "@types/react-dom": "^19.2.2",
 | 
				
			||||||
        "@vitejs/plugin-react": "^5.0.4",
 | 
					        "@vitejs/plugin-react": "^5.0.4",
 | 
				
			||||||
        "eslint": "^9.37.0",
 | 
					        "eslint": "^9.37.0",
 | 
				
			||||||
        "eslint-plugin-react-hooks": "^7.0.0",
 | 
					        "eslint-plugin-react-hooks": "^7.0.0",
 | 
				
			||||||
@@ -45,8 +45,8 @@
 | 
				
			|||||||
        "prettier": "3.6.2",
 | 
					        "prettier": "3.6.2",
 | 
				
			||||||
        "tw-animate-css": "^1.4.0",
 | 
					        "tw-animate-css": "^1.4.0",
 | 
				
			||||||
        "typescript": "~5.9.3",
 | 
					        "typescript": "~5.9.3",
 | 
				
			||||||
        "typescript-eslint": "^8.46.0",
 | 
					        "typescript-eslint": "^8.46.1",
 | 
				
			||||||
        "vite": "^7.1.9",
 | 
					        "vite": "^7.1.10",
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
@@ -329,9 +329,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    "@tanstack/eslint-plugin-query": ["@tanstack/eslint-plugin-query@5.91.0", "", { "dependencies": { "@typescript-eslint/utils": "^8.44.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0" } }, "sha512-Kn6yWyRe3dIPf7NqyDMhcsTBz2Oh8jPSOpBdlnLQhGBJ6iTMBFYA4B1UreGJ/WdfzQskSMh5imcyWF+wqa/Q5g=="],
 | 
					    "@tanstack/eslint-plugin-query": ["@tanstack/eslint-plugin-query@5.91.0", "", { "dependencies": { "@typescript-eslint/utils": "^8.44.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0" } }, "sha512-Kn6yWyRe3dIPf7NqyDMhcsTBz2Oh8jPSOpBdlnLQhGBJ6iTMBFYA4B1UreGJ/WdfzQskSMh5imcyWF+wqa/Q5g=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@tanstack/query-core": ["@tanstack/query-core@5.90.2", "", {}, "sha512-k/TcR3YalnzibscALLwxeiLUub6jN5EDLwKDiO7q5f4ICEoptJ+n9+7vcEFy5/x/i6Q+Lb/tXrsKCggf5uQJXQ=="],
 | 
					    "@tanstack/query-core": ["@tanstack/query-core@5.90.3", "", {}, "sha512-HtPOnCwmx4dd35PfXU8jjkhwYrsHfuqgC8RCJIwWglmhIUIlzPP0ZcEkDAc+UtAWCiLm7T8rxeEfHZlz3hYMCA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@tanstack/react-query": ["@tanstack/react-query@5.90.2", "", { "dependencies": { "@tanstack/query-core": "5.90.2" }, "peerDependencies": { "react": "^18 || ^19" } }, "sha512-CLABiR+h5PYfOWr/z+vWFt5VsOA2ekQeRQBFSKlcoW6Ndx/f8rfyVmq4LbgOM4GG2qtxAxjLYLOpCNTYm4uKzw=="],
 | 
					    "@tanstack/react-query": ["@tanstack/react-query@5.90.3", "", { "dependencies": { "@tanstack/query-core": "5.90.3" }, "peerDependencies": { "react": "^18 || ^19" } }, "sha512-i/LRL6DtuhG6bjGzavIMIVuKKPWx2AnEBIsBfuMm3YoHne0a20nWmsatOCBcVSaT0/8/5YFjNkebHAPLVUSi0Q=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@types/babel__core": ["@types/babel__core@7.20.5", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="],
 | 
					    "@types/babel__core": ["@types/babel__core@7.20.5", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -359,29 +359,29 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    "@types/react": ["@types/react@19.2.2", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA=="],
 | 
					    "@types/react": ["@types/react@19.2.2", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@types/react-dom": ["@types/react-dom@19.2.1", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-/EEvYBdT3BflCWvTMO7YkYBHVE9Ci6XdqZciZANQgKpaiDRGOLIlRo91jbTNRQjgPFWVaRxcYc0luVNFitz57A=="],
 | 
					    "@types/react-dom": ["@types/react-dom@19.2.2", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-9KQPoO6mZCi7jcIStSnlOWn2nEF3mNmyr3rIAsGnAbQKYbRLyqmeSc39EVgtxXVia+LMT8j3knZLAZAh+xLmrw=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@types/unist": ["@types/unist@3.0.3", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],
 | 
					    "@types/unist": ["@types/unist@3.0.3", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.46.0", "", { "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.46.0", "@typescript-eslint/type-utils": "8.46.0", "@typescript-eslint/utils": "8.46.0", "@typescript-eslint/visitor-keys": "8.46.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.46.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-hA8gxBq4ukonVXPy0OKhiaUh/68D0E88GSmtC1iAEnGaieuDi38LhS7jdCHRLi6ErJBNDGCzvh5EnzdPwUc0DA=="],
 | 
					    "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.46.1", "", { "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.46.1", "@typescript-eslint/type-utils": "8.46.1", "@typescript-eslint/utils": "8.46.1", "@typescript-eslint/visitor-keys": "8.46.1", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.46.1", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-rUsLh8PXmBjdiPY+Emjz9NX2yHvhS11v0SR6xNJkm5GM1MO9ea/1GoDKlHHZGrOJclL/cZ2i/vRUYVtjRhrHVQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/parser": ["@typescript-eslint/parser@8.46.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.46.0", "@typescript-eslint/types": "8.46.0", "@typescript-eslint/typescript-estree": "8.46.0", "@typescript-eslint/visitor-keys": "8.46.0", "debug": "^4.3.4" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-n1H6IcDhmmUEG7TNVSspGmiHHutt7iVKtZwRppD7e04wha5MrkV1h3pti9xQLcCMt6YWsncpoT0HMjkH1FNwWQ=="],
 | 
					    "@typescript-eslint/parser": ["@typescript-eslint/parser@8.46.1", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.46.1", "@typescript-eslint/types": "8.46.1", "@typescript-eslint/typescript-estree": "8.46.1", "@typescript-eslint/visitor-keys": "8.46.1", "debug": "^4.3.4" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-6JSSaBZmsKvEkbRUkf7Zj7dru/8ZCrJxAqArcLaVMee5907JdtEbKGsZ7zNiIm/UAkpGUkaSMZEXShnN2D1HZA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.46.0", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.46.0", "@typescript-eslint/types": "^8.46.0", "debug": "^4.3.4" }, "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-OEhec0mH+U5Je2NZOeK1AbVCdm0ChyapAyTeXVIYTPXDJ3F07+cu87PPXcGoYqZ7M9YJVvFnfpGg1UmCIqM+QQ=="],
 | 
					    "@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.46.1", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.46.1", "@typescript-eslint/types": "^8.46.1", "debug": "^4.3.4" }, "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-FOIaFVMHzRskXr5J4Jp8lFVV0gz5ngv3RHmn+E4HYxSJ3DgDzU7fVI1/M7Ijh1zf6S7HIoaIOtln1H5y8V+9Zg=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.45.0", "", { "dependencies": { "@typescript-eslint/types": "8.45.0", "@typescript-eslint/visitor-keys": "8.45.0" } }, "sha512-clmm8XSNj/1dGvJeO6VGH7EUSeA0FMs+5au/u3lrA3KfG8iJ4u8ym9/j2tTEoacAffdW1TVUzXO30W1JTJS7dA=="],
 | 
					    "@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.45.0", "", { "dependencies": { "@typescript-eslint/types": "8.45.0", "@typescript-eslint/visitor-keys": "8.45.0" } }, "sha512-clmm8XSNj/1dGvJeO6VGH7EUSeA0FMs+5au/u3lrA3KfG8iJ4u8ym9/j2tTEoacAffdW1TVUzXO30W1JTJS7dA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.46.0", "", { "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-WrYXKGAHY836/N7zoK/kzi6p8tXFhasHh8ocFL9VZSAkvH956gfeRfcnhs3xzRy8qQ/dq3q44v1jvQieMFg2cw=="],
 | 
					    "@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.46.1", "", { "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-X88+J/CwFvlJB+mK09VFqx5FE4H5cXD+H/Bdza2aEWkSb8hnWIQorNcscRl4IEo1Cz9VI/+/r/jnGWkbWPx54g=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.46.0", "", { "dependencies": { "@typescript-eslint/types": "8.46.0", "@typescript-eslint/typescript-estree": "8.46.0", "@typescript-eslint/utils": "8.46.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-hy+lvYV1lZpVs2jRaEYvgCblZxUoJiPyCemwbQZ+NGulWkQRy0HRPYAoef/CNSzaLt+MLvMptZsHXHlkEilaeg=="],
 | 
					    "@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.46.1", "", { "dependencies": { "@typescript-eslint/types": "8.46.1", "@typescript-eslint/typescript-estree": "8.46.1", "@typescript-eslint/utils": "8.46.1", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-+BlmiHIiqufBxkVnOtFwjah/vrkF4MtKKvpXrKSPLCkCtAp8H01/VV43sfqA98Od7nJpDcFnkwgyfQbOG0AMvw=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/types": ["@typescript-eslint/types@8.45.0", "", {}, "sha512-WugXLuOIq67BMgQInIxxnsSyRLFxdkJEJu8r4ngLR56q/4Q5LrbfkFRH27vMTjxEK8Pyz7QfzuZe/G15qQnVRA=="],
 | 
					    "@typescript-eslint/types": ["@typescript-eslint/types@8.45.0", "", {}, "sha512-WugXLuOIq67BMgQInIxxnsSyRLFxdkJEJu8r4ngLR56q/4Q5LrbfkFRH27vMTjxEK8Pyz7QfzuZe/G15qQnVRA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.46.0", "", { "dependencies": { "@typescript-eslint/project-service": "8.46.0", "@typescript-eslint/tsconfig-utils": "8.46.0", "@typescript-eslint/types": "8.46.0", "@typescript-eslint/visitor-keys": "8.46.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-ekDCUfVpAKWJbRfm8T1YRrCot1KFxZn21oV76v5Fj4tr7ELyk84OS+ouvYdcDAwZL89WpEkEj2DKQ+qg//+ucg=="],
 | 
					    "@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.46.1", "", { "dependencies": { "@typescript-eslint/project-service": "8.46.1", "@typescript-eslint/tsconfig-utils": "8.46.1", "@typescript-eslint/types": "8.46.1", "@typescript-eslint/visitor-keys": "8.46.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-uIifjT4s8cQKFQ8ZBXXyoUODtRoAd7F7+G8MKmtzj17+1UbdzFl52AzRyZRyKqPHhgzvXunnSckVu36flGy8cg=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/utils": ["@typescript-eslint/utils@8.45.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", "@typescript-eslint/scope-manager": "8.45.0", "@typescript-eslint/types": "8.45.0", "@typescript-eslint/typescript-estree": "8.45.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-bxi1ht+tLYg4+XV2knz/F7RVhU0k6VrSMc9sb8DQ6fyCTrGQLHfo7lDtN0QJjZjKkLA2ThrKuCdHEvLReqtIGg=="],
 | 
					    "@typescript-eslint/utils": ["@typescript-eslint/utils@8.45.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", "@typescript-eslint/scope-manager": "8.45.0", "@typescript-eslint/types": "8.45.0", "@typescript-eslint/typescript-estree": "8.45.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-bxi1ht+tLYg4+XV2knz/F7RVhU0k6VrSMc9sb8DQ6fyCTrGQLHfo7lDtN0QJjZjKkLA2ThrKuCdHEvLReqtIGg=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.46.0", "", { "dependencies": { "@typescript-eslint/types": "8.46.0", "eslint-visitor-keys": "^4.2.1" } }, "sha512-FrvMpAK+hTbFy7vH5j1+tMYHMSKLE6RzluFJlkFNKD0p9YsUT75JlBSmr5so3QRzvMwU5/bIEdeNrxm8du8l3Q=="],
 | 
					    "@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.46.1", "", { "dependencies": { "@typescript-eslint/types": "8.46.1", "eslint-visitor-keys": "^4.2.1" } }, "sha512-ptkmIf2iDkNUjdeu2bQqhFPV1m6qTnFFjg7PPDjxKWaMaP0Z6I9l30Jr3g5QqbZGdw8YdYvLp+XnqnWWZOg/NA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@ungap/structured-clone": ["@ungap/structured-clone@1.3.0", "", {}, "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g=="],
 | 
					    "@ungap/structured-clone": ["@ungap/structured-clone@1.3.0", "", {}, "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -793,7 +793,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    "react-hook-form": ["react-hook-form@7.65.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17 || ^18 || ^19" } }, "sha512-xtOzDz063WcXvGWaHgLNrNzlsdFgtUWcb32E6WFaGTd7kPZG3EeDusjdZfUsPwKCKVXy1ZlntifaHZ4l8pAsmw=="],
 | 
					    "react-hook-form": ["react-hook-form@7.65.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17 || ^18 || ^19" } }, "sha512-xtOzDz063WcXvGWaHgLNrNzlsdFgtUWcb32E6WFaGTd7kPZG3EeDusjdZfUsPwKCKVXy1ZlntifaHZ4l8pAsmw=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "react-i18next": ["react-i18next@16.0.0", "", { "dependencies": { "@babel/runtime": "^7.27.6", "html-parse-stringify": "^3.0.1" }, "peerDependencies": { "i18next": ">= 25.5.2", "react": ">= 16.8.0", "typescript": "^5" }, "optionalPeers": ["typescript"] }, "sha512-JQ+dFfLnFSKJQt7W01lJHWRC0SX7eDPobI+MSTJ3/gP39xH2g33AuTE7iddAfXYHamJdAeMGM0VFboPaD3G68Q=="],
 | 
					    "react-i18next": ["react-i18next@16.0.1", "", { "dependencies": { "@babel/runtime": "^7.27.6", "html-parse-stringify": "^3.0.1" }, "peerDependencies": { "i18next": ">= 25.5.2", "react": ">= 16.8.0", "typescript": "^5" }, "optionalPeers": ["typescript"] }, "sha512-0S//bpYEkCPjzuVmxDf9Z6+Y+ArNvpAUk7eDL4qNCZXjDh6Z9j6MZ+NThU7kMCOsmYmDCun3GYEwkiOjjZo9Ug=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "react-markdown": ["react-markdown@10.1.0", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "hast-util-to-jsx-runtime": "^2.0.0", "html-url-attributes": "^3.0.0", "mdast-util-to-hast": "^13.0.0", "remark-parse": "^11.0.0", "remark-rehype": "^11.0.0", "unified": "^11.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" }, "peerDependencies": { "@types/react": ">=18", "react": ">=18" } }, "sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ=="],
 | 
					    "react-markdown": ["react-markdown@10.1.0", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "hast-util-to-jsx-runtime": "^2.0.0", "html-url-attributes": "^3.0.0", "mdast-util-to-hast": "^13.0.0", "remark-parse": "^11.0.0", "remark-rehype": "^11.0.0", "unified": "^11.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" }, "peerDependencies": { "@types/react": ">=18", "react": ">=18" } }, "sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -871,7 +871,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
 | 
					    "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "typescript-eslint": ["typescript-eslint@8.46.0", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.46.0", "@typescript-eslint/parser": "8.46.0", "@typescript-eslint/typescript-estree": "8.46.0", "@typescript-eslint/utils": "8.46.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-6+ZrB6y2bT2DX3K+Qd9vn7OFOJR+xSLDj+Aw/N3zBwUt27uTw2sw2TE2+UcY1RiyBZkaGbTkVg9SSdPNUG6aUw=="],
 | 
					    "typescript-eslint": ["typescript-eslint@8.46.1", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.46.1", "@typescript-eslint/parser": "8.46.1", "@typescript-eslint/typescript-estree": "8.46.1", "@typescript-eslint/utils": "8.46.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-VHgijW803JafdSsDO8I761r3SHrgk4T00IdyQ+/UsthtgPRsBWQLqoSxOolxTpxRKi1kGXK0bSz4CoAc9ObqJA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "undici-types": ["undici-types@7.14.0", "", {}, "sha512-QQiYxHuyZ9gQUIrmPo3IA+hUl4KYk8uSA7cHrcKd/l3p1OTpZcM0Tbp9x7FAtXdAYhlasd60ncPpgu6ihG6TOA=="],
 | 
					    "undici-types": ["undici-types@7.14.0", "", {}, "sha512-QQiYxHuyZ9gQUIrmPo3IA+hUl4KYk8uSA7cHrcKd/l3p1OTpZcM0Tbp9x7FAtXdAYhlasd60ncPpgu6ihG6TOA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -899,7 +899,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    "vfile-message": ["vfile-message@4.0.2", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-stringify-position": "^4.0.0" } }, "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw=="],
 | 
					    "vfile-message": ["vfile-message@4.0.2", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-stringify-position": "^4.0.0" } }, "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "vite": ["vite@7.1.9", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-4nVGliEpxmhCL8DslSAUdxlB6+SMrhB0a1v5ijlh1xB1nEPuy1mxaHxysVucLHuWryAxLWg6a5ei+U4TLn/rFg=="],
 | 
					    "vite": ["vite@7.1.10", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-CmuvUBzVJ/e3HGxhg6cYk88NGgTnBoOo7ogtfJJ0fefUWAxN/WDSUa50o+oVBxuIhO8FoEZW0j2eW7sfjs5EtA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "void-elements": ["void-elements@3.1.0", "", {}, "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w=="],
 | 
					    "void-elements": ["void-elements@3.1.0", "", {}, "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -971,25 +971,25 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    "@types/estree-jsx/@types/estree": ["@types/estree@1.0.7", "", {}, "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ=="],
 | 
					    "@types/estree-jsx/@types/estree": ["@types/estree@1.0.7", "", {}, "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/eslint-plugin/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.46.0", "", { "dependencies": { "@typescript-eslint/types": "8.46.0", "@typescript-eslint/visitor-keys": "8.46.0" } }, "sha512-lWETPa9XGcBes4jqAMYD9fW0j4n6hrPtTJwWDmtqgFO/4HF4jmdH/Q6wggTw5qIT5TXjKzbt7GsZUBnWoO3dqw=="],
 | 
					    "@typescript-eslint/eslint-plugin/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.46.1", "", { "dependencies": { "@typescript-eslint/types": "8.46.1", "@typescript-eslint/visitor-keys": "8.46.1" } }, "sha512-weL9Gg3/5F0pVQKiF8eOXFZp8emqWzZsOJuWRUNtHT+UNV2xSJegmpCNQHy37aEQIbToTq7RHKhWvOsmbM680A=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/eslint-plugin/@typescript-eslint/utils": ["@typescript-eslint/utils@8.46.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", "@typescript-eslint/scope-manager": "8.46.0", "@typescript-eslint/types": "8.46.0", "@typescript-eslint/typescript-estree": "8.46.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-nD6yGWPj1xiOm4Gk0k6hLSZz2XkNXhuYmyIrOWcHoPuAhjT9i5bAG+xbWPgFeNR8HPHHtpNKdYUXJl/D3x7f5g=="],
 | 
					    "@typescript-eslint/eslint-plugin/@typescript-eslint/utils": ["@typescript-eslint/utils@8.46.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", "@typescript-eslint/scope-manager": "8.46.1", "@typescript-eslint/types": "8.46.1", "@typescript-eslint/typescript-estree": "8.46.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-vkYUy6LdZS7q1v/Gxb2Zs7zziuXN0wxqsetJdeZdRe/f5dwJFglmuvZBfTUivCtjH725C1jWCDfpadadD95EDQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/eslint-plugin/ignore": ["ignore@7.0.4", "", {}, "sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A=="],
 | 
					    "@typescript-eslint/eslint-plugin/ignore": ["ignore@7.0.4", "", {}, "sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/parser/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.46.0", "", { "dependencies": { "@typescript-eslint/types": "8.46.0", "@typescript-eslint/visitor-keys": "8.46.0" } }, "sha512-lWETPa9XGcBes4jqAMYD9fW0j4n6hrPtTJwWDmtqgFO/4HF4jmdH/Q6wggTw5qIT5TXjKzbt7GsZUBnWoO3dqw=="],
 | 
					    "@typescript-eslint/parser/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.46.1", "", { "dependencies": { "@typescript-eslint/types": "8.46.1", "@typescript-eslint/visitor-keys": "8.46.1" } }, "sha512-weL9Gg3/5F0pVQKiF8eOXFZp8emqWzZsOJuWRUNtHT+UNV2xSJegmpCNQHy37aEQIbToTq7RHKhWvOsmbM680A=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/parser/@typescript-eslint/types": ["@typescript-eslint/types@8.46.0", "", {}, "sha512-bHGGJyVjSE4dJJIO5yyEWt/cHyNwga/zXGJbJJ8TiO01aVREK6gCTu3L+5wrkb1FbDkQ+TKjMNe9R/QQQP9+rA=="],
 | 
					    "@typescript-eslint/parser/@typescript-eslint/types": ["@typescript-eslint/types@8.46.1", "", {}, "sha512-C+soprGBHwWBdkDpbaRC4paGBrkIXxVlNohadL5o0kfhsXqOC6GYH2S/Obmig+I0HTDl8wMaRySwrfrXVP8/pQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/project-service/@typescript-eslint/types": ["@typescript-eslint/types@8.46.0", "", {}, "sha512-bHGGJyVjSE4dJJIO5yyEWt/cHyNwga/zXGJbJJ8TiO01aVREK6gCTu3L+5wrkb1FbDkQ+TKjMNe9R/QQQP9+rA=="],
 | 
					    "@typescript-eslint/project-service/@typescript-eslint/types": ["@typescript-eslint/types@8.46.1", "", {}, "sha512-C+soprGBHwWBdkDpbaRC4paGBrkIXxVlNohadL5o0kfhsXqOC6GYH2S/Obmig+I0HTDl8wMaRySwrfrXVP8/pQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/scope-manager/@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.45.0", "", { "dependencies": { "@typescript-eslint/types": "8.45.0", "eslint-visitor-keys": "^4.2.1" } }, "sha512-qsaFBA3e09MIDAGFUrTk+dzqtfv1XPVz8t8d1f0ybTzrCY7BKiMC5cjrl1O/P7UmHsNyW90EYSkU/ZWpmXelag=="],
 | 
					    "@typescript-eslint/scope-manager/@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.45.0", "", { "dependencies": { "@typescript-eslint/types": "8.45.0", "eslint-visitor-keys": "^4.2.1" } }, "sha512-qsaFBA3e09MIDAGFUrTk+dzqtfv1XPVz8t8d1f0ybTzrCY7BKiMC5cjrl1O/P7UmHsNyW90EYSkU/ZWpmXelag=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/type-utils/@typescript-eslint/types": ["@typescript-eslint/types@8.46.0", "", {}, "sha512-bHGGJyVjSE4dJJIO5yyEWt/cHyNwga/zXGJbJJ8TiO01aVREK6gCTu3L+5wrkb1FbDkQ+TKjMNe9R/QQQP9+rA=="],
 | 
					    "@typescript-eslint/type-utils/@typescript-eslint/types": ["@typescript-eslint/types@8.46.1", "", {}, "sha512-C+soprGBHwWBdkDpbaRC4paGBrkIXxVlNohadL5o0kfhsXqOC6GYH2S/Obmig+I0HTDl8wMaRySwrfrXVP8/pQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/type-utils/@typescript-eslint/utils": ["@typescript-eslint/utils@8.46.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", "@typescript-eslint/scope-manager": "8.46.0", "@typescript-eslint/types": "8.46.0", "@typescript-eslint/typescript-estree": "8.46.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-nD6yGWPj1xiOm4Gk0k6hLSZz2XkNXhuYmyIrOWcHoPuAhjT9i5bAG+xbWPgFeNR8HPHHtpNKdYUXJl/D3x7f5g=="],
 | 
					    "@typescript-eslint/type-utils/@typescript-eslint/utils": ["@typescript-eslint/utils@8.46.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", "@typescript-eslint/scope-manager": "8.46.1", "@typescript-eslint/types": "8.46.1", "@typescript-eslint/typescript-estree": "8.46.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-vkYUy6LdZS7q1v/Gxb2Zs7zziuXN0wxqsetJdeZdRe/f5dwJFglmuvZBfTUivCtjH725C1jWCDfpadadD95EDQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/typescript-estree/@typescript-eslint/types": ["@typescript-eslint/types@8.46.0", "", {}, "sha512-bHGGJyVjSE4dJJIO5yyEWt/cHyNwga/zXGJbJJ8TiO01aVREK6gCTu3L+5wrkb1FbDkQ+TKjMNe9R/QQQP9+rA=="],
 | 
					    "@typescript-eslint/typescript-estree/@typescript-eslint/types": ["@typescript-eslint/types@8.46.1", "", {}, "sha512-C+soprGBHwWBdkDpbaRC4paGBrkIXxVlNohadL5o0kfhsXqOC6GYH2S/Obmig+I0HTDl8wMaRySwrfrXVP8/pQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
 | 
					    "@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -997,7 +997,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/utils/@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.45.0", "", { "dependencies": { "@typescript-eslint/project-service": "8.45.0", "@typescript-eslint/tsconfig-utils": "8.45.0", "@typescript-eslint/types": "8.45.0", "@typescript-eslint/visitor-keys": "8.45.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-GfE1NfVbLam6XQ0LcERKwdTTPlLvHvXXhOeUGC1OXi4eQBoyy1iVsW+uzJ/J9jtCz6/7GCQ9MtrQ0fml/jWCnA=="],
 | 
					    "@typescript-eslint/utils/@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.45.0", "", { "dependencies": { "@typescript-eslint/project-service": "8.45.0", "@typescript-eslint/tsconfig-utils": "8.45.0", "@typescript-eslint/types": "8.45.0", "@typescript-eslint/visitor-keys": "8.45.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-GfE1NfVbLam6XQ0LcERKwdTTPlLvHvXXhOeUGC1OXi4eQBoyy1iVsW+uzJ/J9jtCz6/7GCQ9MtrQ0fml/jWCnA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/visitor-keys/@typescript-eslint/types": ["@typescript-eslint/types@8.46.0", "", {}, "sha512-bHGGJyVjSE4dJJIO5yyEWt/cHyNwga/zXGJbJJ8TiO01aVREK6gCTu3L+5wrkb1FbDkQ+TKjMNe9R/QQQP9+rA=="],
 | 
					    "@typescript-eslint/visitor-keys/@typescript-eslint/types": ["@typescript-eslint/types@8.46.1", "", {}, "sha512-C+soprGBHwWBdkDpbaRC4paGBrkIXxVlNohadL5o0kfhsXqOC6GYH2S/Obmig+I0HTDl8wMaRySwrfrXVP8/pQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
 | 
					    "fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1013,7 +1013,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    "parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="],
 | 
					    "parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "typescript-eslint/@typescript-eslint/utils": ["@typescript-eslint/utils@8.46.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", "@typescript-eslint/scope-manager": "8.46.0", "@typescript-eslint/types": "8.46.0", "@typescript-eslint/typescript-estree": "8.46.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-nD6yGWPj1xiOm4Gk0k6hLSZz2XkNXhuYmyIrOWcHoPuAhjT9i5bAG+xbWPgFeNR8HPHHtpNKdYUXJl/D3x7f5g=="],
 | 
					    "typescript-eslint/@typescript-eslint/utils": ["@typescript-eslint/utils@8.46.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", "@typescript-eslint/scope-manager": "8.46.1", "@typescript-eslint/types": "8.46.1", "@typescript-eslint/typescript-estree": "8.46.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-vkYUy6LdZS7q1v/Gxb2Zs7zziuXN0wxqsetJdeZdRe/f5dwJFglmuvZBfTUivCtjH725C1jWCDfpadadD95EDQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@babel/helper-module-imports/@babel/traverse/@babel/generator": ["@babel/generator@7.27.1", "", { "dependencies": { "@babel/parser": "^7.27.1", "@babel/types": "^7.27.1", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" } }, "sha512-UnJfnIpc/+JO0/+KRVQNGU+y5taA5vCbwN8+azkX6beii/ZF+enZJSOKo11ZSzGJjlNfJHfQtmQT8H+9TXPG2w=="],
 | 
					    "@babel/helper-module-imports/@babel/traverse/@babel/generator": ["@babel/generator@7.27.1", "", { "dependencies": { "@babel/parser": "^7.27.1", "@babel/types": "^7.27.1", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" } }, "sha512-UnJfnIpc/+JO0/+KRVQNGU+y5taA5vCbwN8+azkX6beii/ZF+enZJSOKo11ZSzGJjlNfJHfQtmQT8H+9TXPG2w=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1029,11 +1029,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    "@eslint/eslintrc/espree/eslint-visitor-keys": ["eslint-visitor-keys@4.2.0", "", {}, "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw=="],
 | 
					    "@eslint/eslintrc/espree/eslint-visitor-keys": ["eslint-visitor-keys@4.2.0", "", {}, "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/eslint-plugin/@typescript-eslint/scope-manager/@typescript-eslint/types": ["@typescript-eslint/types@8.46.0", "", {}, "sha512-bHGGJyVjSE4dJJIO5yyEWt/cHyNwga/zXGJbJJ8TiO01aVREK6gCTu3L+5wrkb1FbDkQ+TKjMNe9R/QQQP9+rA=="],
 | 
					    "@typescript-eslint/eslint-plugin/@typescript-eslint/scope-manager/@typescript-eslint/types": ["@typescript-eslint/types@8.46.1", "", {}, "sha512-C+soprGBHwWBdkDpbaRC4paGBrkIXxVlNohadL5o0kfhsXqOC6GYH2S/Obmig+I0HTDl8wMaRySwrfrXVP8/pQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/eslint-plugin/@typescript-eslint/utils/@typescript-eslint/types": ["@typescript-eslint/types@8.46.0", "", {}, "sha512-bHGGJyVjSE4dJJIO5yyEWt/cHyNwga/zXGJbJJ8TiO01aVREK6gCTu3L+5wrkb1FbDkQ+TKjMNe9R/QQQP9+rA=="],
 | 
					    "@typescript-eslint/eslint-plugin/@typescript-eslint/utils/@typescript-eslint/types": ["@typescript-eslint/types@8.46.1", "", {}, "sha512-C+soprGBHwWBdkDpbaRC4paGBrkIXxVlNohadL5o0kfhsXqOC6GYH2S/Obmig+I0HTDl8wMaRySwrfrXVP8/pQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/type-utils/@typescript-eslint/utils/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.46.0", "", { "dependencies": { "@typescript-eslint/types": "8.46.0", "@typescript-eslint/visitor-keys": "8.46.0" } }, "sha512-lWETPa9XGcBes4jqAMYD9fW0j4n6hrPtTJwWDmtqgFO/4HF4jmdH/Q6wggTw5qIT5TXjKzbt7GsZUBnWoO3dqw=="],
 | 
					    "@typescript-eslint/type-utils/@typescript-eslint/utils/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.46.1", "", { "dependencies": { "@typescript-eslint/types": "8.46.1", "@typescript-eslint/visitor-keys": "8.46.1" } }, "sha512-weL9Gg3/5F0pVQKiF8eOXFZp8emqWzZsOJuWRUNtHT+UNV2xSJegmpCNQHy37aEQIbToTq7RHKhWvOsmbM680A=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
 | 
					    "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1047,9 +1047,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    "@typescript-eslint/utils/@typescript-eslint/typescript-estree/semver": ["semver@7.7.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA=="],
 | 
					    "@typescript-eslint/utils/@typescript-eslint/typescript-estree/semver": ["semver@7.7.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "typescript-eslint/@typescript-eslint/utils/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.46.0", "", { "dependencies": { "@typescript-eslint/types": "8.46.0", "@typescript-eslint/visitor-keys": "8.46.0" } }, "sha512-lWETPa9XGcBes4jqAMYD9fW0j4n6hrPtTJwWDmtqgFO/4HF4jmdH/Q6wggTw5qIT5TXjKzbt7GsZUBnWoO3dqw=="],
 | 
					    "typescript-eslint/@typescript-eslint/utils/@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.46.1", "", { "dependencies": { "@typescript-eslint/types": "8.46.1", "@typescript-eslint/visitor-keys": "8.46.1" } }, "sha512-weL9Gg3/5F0pVQKiF8eOXFZp8emqWzZsOJuWRUNtHT+UNV2xSJegmpCNQHy37aEQIbToTq7RHKhWvOsmbM680A=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "typescript-eslint/@typescript-eslint/utils/@typescript-eslint/types": ["@typescript-eslint/types@8.46.0", "", {}, "sha512-bHGGJyVjSE4dJJIO5yyEWt/cHyNwga/zXGJbJJ8TiO01aVREK6gCTu3L+5wrkb1FbDkQ+TKjMNe9R/QQQP9+rA=="],
 | 
					    "typescript-eslint/@typescript-eslint/utils/@typescript-eslint/types": ["@typescript-eslint/types@8.46.1", "", {}, "sha512-C+soprGBHwWBdkDpbaRC4paGBrkIXxVlNohadL5o0kfhsXqOC6GYH2S/Obmig+I0HTDl8wMaRySwrfrXVP8/pQ=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "@babel/helper-module-imports/@babel/traverse/@babel/generator/@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.8", "", { "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA=="],
 | 
					    "@babel/helper-module-imports/@babel/traverse/@babel/generator/@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.8", "", { "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA=="],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,7 +16,7 @@
 | 
				
			|||||||
    "@radix-ui/react-separator": "^1.1.7",
 | 
					    "@radix-ui/react-separator": "^1.1.7",
 | 
				
			||||||
    "@radix-ui/react-slot": "^1.2.3",
 | 
					    "@radix-ui/react-slot": "^1.2.3",
 | 
				
			||||||
    "@tailwindcss/vite": "^4.1.14",
 | 
					    "@tailwindcss/vite": "^4.1.14",
 | 
				
			||||||
    "@tanstack/react-query": "^5.90.2",
 | 
					    "@tanstack/react-query": "^5.90.3",
 | 
				
			||||||
    "axios": "^1.12.2",
 | 
					    "axios": "^1.12.2",
 | 
				
			||||||
    "class-variance-authority": "^0.7.1",
 | 
					    "class-variance-authority": "^0.7.1",
 | 
				
			||||||
    "clsx": "^2.1.1",
 | 
					    "clsx": "^2.1.1",
 | 
				
			||||||
@@ -29,7 +29,7 @@
 | 
				
			|||||||
    "react": "^19.2.0",
 | 
					    "react": "^19.2.0",
 | 
				
			||||||
    "react-dom": "^19.2.0",
 | 
					    "react-dom": "^19.2.0",
 | 
				
			||||||
    "react-hook-form": "^7.65.0",
 | 
					    "react-hook-form": "^7.65.0",
 | 
				
			||||||
    "react-i18next": "^16.0.0",
 | 
					    "react-i18next": "^16.0.1",
 | 
				
			||||||
    "react-markdown": "^10.1.0",
 | 
					    "react-markdown": "^10.1.0",
 | 
				
			||||||
    "react-router": "^7.9.4",
 | 
					    "react-router": "^7.9.4",
 | 
				
			||||||
    "sonner": "^2.0.7",
 | 
					    "sonner": "^2.0.7",
 | 
				
			||||||
@@ -42,7 +42,7 @@
 | 
				
			|||||||
    "@tanstack/eslint-plugin-query": "^5.91.0",
 | 
					    "@tanstack/eslint-plugin-query": "^5.91.0",
 | 
				
			||||||
    "@types/node": "^24.7.2",
 | 
					    "@types/node": "^24.7.2",
 | 
				
			||||||
    "@types/react": "^19.2.2",
 | 
					    "@types/react": "^19.2.2",
 | 
				
			||||||
    "@types/react-dom": "^19.2.1",
 | 
					    "@types/react-dom": "^19.2.2",
 | 
				
			||||||
    "@vitejs/plugin-react": "^5.0.4",
 | 
					    "@vitejs/plugin-react": "^5.0.4",
 | 
				
			||||||
    "eslint": "^9.37.0",
 | 
					    "eslint": "^9.37.0",
 | 
				
			||||||
    "eslint-plugin-react-hooks": "^7.0.0",
 | 
					    "eslint-plugin-react-hooks": "^7.0.0",
 | 
				
			||||||
@@ -51,7 +51,7 @@
 | 
				
			|||||||
    "prettier": "3.6.2",
 | 
					    "prettier": "3.6.2",
 | 
				
			||||||
    "tw-animate-css": "^1.4.0",
 | 
					    "tw-animate-css": "^1.4.0",
 | 
				
			||||||
    "typescript": "~5.9.3",
 | 
					    "typescript": "~5.9.3",
 | 
				
			||||||
    "typescript-eslint": "^8.46.0",
 | 
					    "typescript-eslint": "^8.46.1",
 | 
				
			||||||
    "vite": "^7.1.9"
 | 
					    "vite": "^7.1.10"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										9
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								go.mod
									
									
									
									
									
								
							@@ -47,6 +47,7 @@ require (
 | 
				
			|||||||
	github.com/quic-go/qpack v0.5.1 // indirect
 | 
						github.com/quic-go/qpack v0.5.1 // indirect
 | 
				
			||||||
	github.com/quic-go/quic-go v0.54.1 // indirect
 | 
						github.com/quic-go/quic-go v0.54.1 // indirect
 | 
				
			||||||
	github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
 | 
						github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
 | 
				
			||||||
 | 
						github.com/stoewer/go-strcase v1.3.1 // indirect
 | 
				
			||||||
	github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
 | 
						github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
 | 
				
			||||||
	go.opentelemetry.io/auto/sdk v1.1.0 // indirect
 | 
						go.opentelemetry.io/auto/sdk v1.1.0 // indirect
 | 
				
			||||||
	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 // indirect
 | 
						go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 // indirect
 | 
				
			||||||
@@ -71,11 +72,11 @@ require (
 | 
				
			|||||||
	github.com/bytedance/sonic v1.14.0 // indirect
 | 
						github.com/bytedance/sonic v1.14.0 // indirect
 | 
				
			||||||
	github.com/bytedance/sonic/loader v0.3.0 // indirect
 | 
						github.com/bytedance/sonic/loader v0.3.0 // indirect
 | 
				
			||||||
	github.com/catppuccin/go v0.3.0 // indirect
 | 
						github.com/catppuccin/go v0.3.0 // indirect
 | 
				
			||||||
	github.com/charmbracelet/bubbles v0.21.0 // indirect
 | 
						github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7 // indirect
 | 
				
			||||||
	github.com/charmbracelet/bubbletea v1.3.4 // indirect
 | 
						github.com/charmbracelet/bubbletea v1.3.6 // indirect
 | 
				
			||||||
	github.com/charmbracelet/huh v0.7.0
 | 
						github.com/charmbracelet/huh v0.8.0
 | 
				
			||||||
	github.com/charmbracelet/lipgloss v1.1.0 // indirect
 | 
						github.com/charmbracelet/lipgloss v1.1.0 // indirect
 | 
				
			||||||
	github.com/charmbracelet/x/ansi v0.8.0 // indirect
 | 
						github.com/charmbracelet/x/ansi v0.9.3 // indirect
 | 
				
			||||||
	github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 // indirect
 | 
						github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 // indirect
 | 
				
			||||||
	github.com/charmbracelet/x/term v0.2.1 // indirect
 | 
						github.com/charmbracelet/x/term v0.2.1 // indirect
 | 
				
			||||||
	github.com/cloudwego/base64x v0.1.6 // indirect
 | 
						github.com/cloudwego/base64x v0.1.6 // indirect
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										22
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								go.sum
									
									
									
									
									
								
							@@ -12,8 +12,8 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z
 | 
				
			|||||||
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
 | 
					github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
 | 
				
			||||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
 | 
					github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
 | 
				
			||||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
 | 
					github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
 | 
				
			||||||
github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8=
 | 
					github.com/aymanbagabas/go-udiff v0.3.1 h1:LV+qyBQ2pqe0u42ZsUEtPiCaUoqgA9gYRDs3vj1nolY=
 | 
				
			||||||
github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA=
 | 
					github.com/aymanbagabas/go-udiff v0.3.1/go.mod h1:G0fsKmG+P6ylD0r6N/KgQD/nWzgfnl8ZBcNLgcbrw8E=
 | 
				
			||||||
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
 | 
					github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
 | 
				
			||||||
github.com/boombuler/barcode v1.0.2 h1:79yrbttoZrLGkL/oOI8hBrUKucwOL0oOjUgEguGMcJ4=
 | 
					github.com/boombuler/barcode v1.0.2 h1:79yrbttoZrLGkL/oOI8hBrUKucwOL0oOjUgEguGMcJ4=
 | 
				
			||||||
github.com/boombuler/barcode v1.0.2/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
 | 
					github.com/boombuler/barcode v1.0.2/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
 | 
				
			||||||
@@ -27,18 +27,18 @@ github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK3
 | 
				
			|||||||
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
 | 
					github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
 | 
				
			||||||
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
 | 
					github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
 | 
				
			||||||
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
 | 
					github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
 | 
				
			||||||
github.com/charmbracelet/bubbles v0.21.0 h1:9TdC97SdRVg/1aaXNVWfFH3nnLAwOXr8Fn6u6mfQdFs=
 | 
					github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7 h1:JFgG/xnwFfbezlUnFMJy0nusZvytYysV4SCS2cYbvws=
 | 
				
			||||||
github.com/charmbracelet/bubbles v0.21.0/go.mod h1:HF+v6QUR4HkEpz62dx7ym2xc71/KBHg+zKwJtMw+qtg=
 | 
					github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7/go.mod h1:ISC1gtLcVilLOf23wvTfoQuYbW2q0JevFxPfUzZ9Ybw=
 | 
				
			||||||
github.com/charmbracelet/bubbletea v1.3.4 h1:kCg7B+jSCFPLYRA52SDZjr51kG/fMUEoPoZrkaDHyoI=
 | 
					github.com/charmbracelet/bubbletea v1.3.6 h1:VkHIxPJQeDt0aFJIsVxw8BQdh/F/L2KKZGsK6et5taU=
 | 
				
			||||||
github.com/charmbracelet/bubbletea v1.3.4/go.mod h1:dtcUCyCGEX3g9tosuYiut3MXgY/Jsv9nKVdibKKRRXo=
 | 
					github.com/charmbracelet/bubbletea v1.3.6/go.mod h1:oQD9VCRQFF8KplacJLo28/jofOI2ToOfGYeFgBBxHOc=
 | 
				
			||||||
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs=
 | 
					github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs=
 | 
				
			||||||
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk=
 | 
					github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk=
 | 
				
			||||||
github.com/charmbracelet/huh v0.7.0 h1:W8S1uyGETgj9Tuda3/JdVkc3x7DBLZYPZc4c+/rnRdc=
 | 
					github.com/charmbracelet/huh v0.8.0 h1:Xz/Pm2h64cXQZn/Jvele4J3r7DDiqFCNIVteYukxDvY=
 | 
				
			||||||
github.com/charmbracelet/huh v0.7.0/go.mod h1:UGC3DZHlgOKHvHC07a5vHag41zzhpPFj34U92sOmyuk=
 | 
					github.com/charmbracelet/huh v0.8.0/go.mod h1:5YVc+SlZ1IhQALxRPpkGwwEKftN/+OlJlnJYlDRFqN4=
 | 
				
			||||||
github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
 | 
					github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
 | 
				
			||||||
github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
 | 
					github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
 | 
				
			||||||
github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2llXn7xE=
 | 
					github.com/charmbracelet/x/ansi v0.9.3 h1:BXt5DHS/MKF+LjuK4huWrC6NCvHtexww7dMayh6GXd0=
 | 
				
			||||||
github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q=
 | 
					github.com/charmbracelet/x/ansi v0.9.3/go.mod h1:3RQDQ6lDnROptfpWuUVIUG64bD2g2BgntdxH0Ya5TeE=
 | 
				
			||||||
github.com/charmbracelet/x/cellbuf v0.0.13 h1:/KBBKHuVRbq1lYx5BzEHBAFBP8VcQzJejZ/IA3iR28k=
 | 
					github.com/charmbracelet/x/cellbuf v0.0.13 h1:/KBBKHuVRbq1lYx5BzEHBAFBP8VcQzJejZ/IA3iR28k=
 | 
				
			||||||
github.com/charmbracelet/x/cellbuf v0.0.13/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
 | 
					github.com/charmbracelet/x/cellbuf v0.0.13/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
 | 
				
			||||||
github.com/charmbracelet/x/conpty v0.1.0 h1:4zc8KaIcbiL4mghEON8D72agYtSeIgq8FSThSPQIb+U=
 | 
					github.com/charmbracelet/x/conpty v0.1.0 h1:4zc8KaIcbiL4mghEON8D72agYtSeIgq8FSThSPQIb+U=
 | 
				
			||||||
@@ -259,6 +259,8 @@ github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
 | 
				
			|||||||
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
 | 
					github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
 | 
				
			||||||
github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=
 | 
					github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=
 | 
				
			||||||
github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=
 | 
					github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=
 | 
				
			||||||
 | 
					github.com/stoewer/go-strcase v1.3.1 h1:iS0MdW+kVTxgMoE1LAZyMiYJFKlOzLooE4MxjirtkAs=
 | 
				
			||||||
 | 
					github.com/stoewer/go-strcase v1.3.1/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
 | 
				
			||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 | 
					github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 | 
				
			||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
 | 
					github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
 | 
				
			||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
 | 
					github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@ package bootstrap
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"bytes"
 | 
						"bytes"
 | 
				
			||||||
 | 
						"context"
 | 
				
			||||||
	"encoding/json"
 | 
						"encoding/json"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
@@ -13,11 +14,13 @@ import (
 | 
				
			|||||||
	"tinyauth/internal/config"
 | 
						"tinyauth/internal/config"
 | 
				
			||||||
	"tinyauth/internal/controller"
 | 
						"tinyauth/internal/controller"
 | 
				
			||||||
	"tinyauth/internal/middleware"
 | 
						"tinyauth/internal/middleware"
 | 
				
			||||||
 | 
						"tinyauth/internal/model"
 | 
				
			||||||
	"tinyauth/internal/service"
 | 
						"tinyauth/internal/service"
 | 
				
			||||||
	"tinyauth/internal/utils"
 | 
						"tinyauth/internal/utils"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/gin-gonic/gin"
 | 
						"github.com/gin-gonic/gin"
 | 
				
			||||||
	"github.com/rs/zerolog/log"
 | 
						"github.com/rs/zerolog/log"
 | 
				
			||||||
 | 
						"gorm.io/gorm"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type Controller interface {
 | 
					type Controller interface {
 | 
				
			||||||
@@ -34,13 +37,15 @@ type Service interface {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type BootstrapApp struct {
 | 
					type BootstrapApp struct {
 | 
				
			||||||
	config config.Config
 | 
						config   config.Config
 | 
				
			||||||
	uuid   string
 | 
						aclFlags map[string]string
 | 
				
			||||||
 | 
						uuid     string
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func NewBootstrapApp(config config.Config) *BootstrapApp {
 | 
					func NewBootstrapApp(config config.Config, aclFlags map[string]string) *BootstrapApp {
 | 
				
			||||||
	return &BootstrapApp{
 | 
						return &BootstrapApp{
 | 
				
			||||||
		config: config,
 | 
							config:   config,
 | 
				
			||||||
 | 
							aclFlags: aclFlags,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -136,12 +141,15 @@ func (app *BootstrapApp) Setup() error {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// Create services
 | 
						// Create services
 | 
				
			||||||
	dockerService := service.NewDockerService()
 | 
						dockerService := service.NewDockerService()
 | 
				
			||||||
 | 
						aclsService := service.NewAccessControlsService(dockerService)
 | 
				
			||||||
 | 
						aclsService.SetACLFlags(app.aclFlags)
 | 
				
			||||||
	authService := service.NewAuthService(authConfig, dockerService, ldapService, database)
 | 
						authService := service.NewAuthService(authConfig, dockerService, ldapService, database)
 | 
				
			||||||
	oauthBrokerService := service.NewOAuthBrokerService(oauthProviders)
 | 
						oauthBrokerService := service.NewOAuthBrokerService(oauthProviders)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Initialize services
 | 
						// Initialize services (order matters)
 | 
				
			||||||
	services := []Service{
 | 
						services := []Service{
 | 
				
			||||||
		dockerService,
 | 
							dockerService,
 | 
				
			||||||
 | 
							aclsService,
 | 
				
			||||||
		authService,
 | 
							authService,
 | 
				
			||||||
		oauthBrokerService,
 | 
							oauthBrokerService,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -243,7 +251,7 @@ func (app *BootstrapApp) Setup() error {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	proxyController := controller.NewProxyController(controller.ProxyControllerConfig{
 | 
						proxyController := controller.NewProxyController(controller.ProxyControllerConfig{
 | 
				
			||||||
		AppURL: app.config.AppURL,
 | 
							AppURL: app.config.AppURL,
 | 
				
			||||||
	}, apiRouter, dockerService, authService)
 | 
						}, apiRouter, aclsService, authService)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	userController := controller.NewUserController(controller.UserControllerConfig{
 | 
						userController := controller.NewUserController(controller.UserControllerConfig{
 | 
				
			||||||
		CookieDomain: cookieDomain,
 | 
							CookieDomain: cookieDomain,
 | 
				
			||||||
@@ -277,6 +285,10 @@ func (app *BootstrapApp) Setup() error {
 | 
				
			|||||||
		go app.heartbeat()
 | 
							go app.heartbeat()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Start DB cleanup routine
 | 
				
			||||||
 | 
						log.Debug().Msg("Starting database cleanup routine")
 | 
				
			||||||
 | 
						go app.dbCleanup(database)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Start server
 | 
						// Start server
 | 
				
			||||||
	address := fmt.Sprintf("%s:%d", app.config.Address, app.config.Port)
 | 
						address := fmt.Sprintf("%s:%d", app.config.Address, app.config.Port)
 | 
				
			||||||
	log.Info().Msgf("Starting server on %s", address)
 | 
						log.Info().Msgf("Starting server on %s", address)
 | 
				
			||||||
@@ -338,3 +350,17 @@ func (app *BootstrapApp) heartbeat() {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (app *BootstrapApp) dbCleanup(db *gorm.DB) {
 | 
				
			||||||
 | 
						ticker := time.NewTicker(time.Duration(30) * time.Minute)
 | 
				
			||||||
 | 
						defer ticker.Stop()
 | 
				
			||||||
 | 
						ctx := context.Background()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for ; true; <-ticker.C {
 | 
				
			||||||
 | 
							log.Debug().Msg("Cleaning up old database sessions")
 | 
				
			||||||
 | 
							_, err := gorm.G[model.Session](db).Where("expiry < ?", time.Now().UnixMilli()).Delete(ctx)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								log.Error().Err(err).Msg("Failed to cleanup old sessions")
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -53,16 +53,16 @@ type Claims struct {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type OAuthServiceConfig struct {
 | 
					type OAuthServiceConfig struct {
 | 
				
			||||||
	ClientID           string   `key:"client-id"`
 | 
						ClientID           string `field:"client-id"`
 | 
				
			||||||
	ClientSecret       string   `key:"client-secret"`
 | 
						ClientSecret       string
 | 
				
			||||||
	ClientSecretFile   string   `key:"client-secret-file"`
 | 
						ClientSecretFile   string
 | 
				
			||||||
	Scopes             []string `key:"scopes"`
 | 
						Scopes             []string
 | 
				
			||||||
	RedirectURL        string   `key:"redirect-url"`
 | 
						RedirectURL        string `field:"redirect-url"`
 | 
				
			||||||
	AuthURL            string   `key:"auth-url"`
 | 
						AuthURL            string `field:"auth-url"`
 | 
				
			||||||
	TokenURL           string   `key:"token-url"`
 | 
						TokenURL           string `field:"token-url"`
 | 
				
			||||||
	UserinfoURL        string   `key:"user-info-url"`
 | 
						UserinfoURL        string `field:"user-info-url"`
 | 
				
			||||||
	InsecureSkipVerify bool     `key:"insecure-skip-verify"`
 | 
						InsecureSkipVerify bool
 | 
				
			||||||
	Name               string   `key:"name"`
 | 
						Name               string
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var OverrideProviders = map[string]string{
 | 
					var OverrideProviders = map[string]string{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -72,6 +72,7 @@ func (controller *OAuthController) oauthURLHandler(c *gin.Context) {
 | 
				
			|||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						service.GenerateVerifier()
 | 
				
			||||||
	state := service.GenerateState()
 | 
						state := service.GenerateState()
 | 
				
			||||||
	authURL := service.GetAuthURL(state)
 | 
						authURL := service.GetAuthURL(state)
 | 
				
			||||||
	c.SetCookie(controller.config.CSRFCookieName, state, int(time.Hour.Seconds()), "/", fmt.Sprintf(".%s", controller.config.CookieDomain), controller.config.SecureCookie, true)
 | 
						c.SetCookie(controller.config.CSRFCookieName, state, int(time.Hour.Seconds()), "/", fmt.Sprintf(".%s", controller.config.CookieDomain), controller.config.SecureCookie, true)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,15 +24,15 @@ type ProxyControllerConfig struct {
 | 
				
			|||||||
type ProxyController struct {
 | 
					type ProxyController struct {
 | 
				
			||||||
	config ProxyControllerConfig
 | 
						config ProxyControllerConfig
 | 
				
			||||||
	router *gin.RouterGroup
 | 
						router *gin.RouterGroup
 | 
				
			||||||
	docker *service.DockerService
 | 
						acls   *service.AccessControlsService
 | 
				
			||||||
	auth   *service.AuthService
 | 
						auth   *service.AuthService
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func NewProxyController(config ProxyControllerConfig, router *gin.RouterGroup, docker *service.DockerService, auth *service.AuthService) *ProxyController {
 | 
					func NewProxyController(config ProxyControllerConfig, router *gin.RouterGroup, acls *service.AccessControlsService, auth *service.AuthService) *ProxyController {
 | 
				
			||||||
	return &ProxyController{
 | 
						return &ProxyController{
 | 
				
			||||||
		config: config,
 | 
							config: config,
 | 
				
			||||||
		router: router,
 | 
							router: router,
 | 
				
			||||||
		docker: docker,
 | 
							acls:   acls,
 | 
				
			||||||
		auth:   auth,
 | 
							auth:   auth,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -76,20 +76,21 @@ func (controller *ProxyController) proxyHandler(c *gin.Context) {
 | 
				
			|||||||
	proto := c.Request.Header.Get("X-Forwarded-Proto")
 | 
						proto := c.Request.Header.Get("X-Forwarded-Proto")
 | 
				
			||||||
	host := c.Request.Header.Get("X-Forwarded-Host")
 | 
						host := c.Request.Header.Get("X-Forwarded-Host")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	labels, err := controller.docker.GetLabels(host)
 | 
						// Get acls
 | 
				
			||||||
 | 
						acls, err := controller.acls.GetAccessControls(host)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		log.Error().Err(err).Msg("Failed to get labels from Docker")
 | 
							log.Error().Err(err).Msg("Failed to get access controls for resource")
 | 
				
			||||||
		controller.handleError(c, req, isBrowser)
 | 
							controller.handleError(c, req, isBrowser)
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	log.Trace().Interface("labels", labels).Msg("Labels for resource")
 | 
						log.Trace().Interface("acls", acls).Msg("ACLs for resource")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	clientIP := c.ClientIP()
 | 
						clientIP := c.ClientIP()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if controller.auth.IsBypassedIP(labels.IP, clientIP) {
 | 
						if controller.auth.IsBypassedIP(acls.IP, clientIP) {
 | 
				
			||||||
		controller.setHeaders(c, labels)
 | 
							controller.setHeaders(c, acls)
 | 
				
			||||||
		c.JSON(200, gin.H{
 | 
							c.JSON(200, gin.H{
 | 
				
			||||||
			"status":  200,
 | 
								"status":  200,
 | 
				
			||||||
			"message": "Authenticated",
 | 
								"message": "Authenticated",
 | 
				
			||||||
@@ -97,7 +98,7 @@ func (controller *ProxyController) proxyHandler(c *gin.Context) {
 | 
				
			|||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	authEnabled, err := controller.auth.IsAuthEnabled(uri, labels.Path)
 | 
						authEnabled, err := controller.auth.IsAuthEnabled(uri, acls.Path)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		log.Error().Err(err).Msg("Failed to check if auth is enabled for resource")
 | 
							log.Error().Err(err).Msg("Failed to check if auth is enabled for resource")
 | 
				
			||||||
@@ -107,7 +108,7 @@ func (controller *ProxyController) proxyHandler(c *gin.Context) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if !authEnabled {
 | 
						if !authEnabled {
 | 
				
			||||||
		log.Debug().Msg("Authentication disabled for resource, allowing access")
 | 
							log.Debug().Msg("Authentication disabled for resource, allowing access")
 | 
				
			||||||
		controller.setHeaders(c, labels)
 | 
							controller.setHeaders(c, acls)
 | 
				
			||||||
		c.JSON(200, gin.H{
 | 
							c.JSON(200, gin.H{
 | 
				
			||||||
			"status":  200,
 | 
								"status":  200,
 | 
				
			||||||
			"message": "Authenticated",
 | 
								"message": "Authenticated",
 | 
				
			||||||
@@ -115,7 +116,7 @@ func (controller *ProxyController) proxyHandler(c *gin.Context) {
 | 
				
			|||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if !controller.auth.CheckIP(labels.IP, clientIP) {
 | 
						if !controller.auth.CheckIP(acls.IP, clientIP) {
 | 
				
			||||||
		if req.Proxy == "nginx" || !isBrowser {
 | 
							if req.Proxy == "nginx" || !isBrowser {
 | 
				
			||||||
			c.JSON(401, gin.H{
 | 
								c.JSON(401, gin.H{
 | 
				
			||||||
				"status":  401,
 | 
									"status":  401,
 | 
				
			||||||
@@ -160,7 +161,7 @@ func (controller *ProxyController) proxyHandler(c *gin.Context) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if userContext.IsLoggedIn {
 | 
						if userContext.IsLoggedIn {
 | 
				
			||||||
		appAllowed := controller.auth.IsResourceAllowed(c, userContext, labels)
 | 
							appAllowed := controller.auth.IsResourceAllowed(c, userContext, acls)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if !appAllowed {
 | 
							if !appAllowed {
 | 
				
			||||||
			log.Warn().Str("user", userContext.Username).Str("resource", strings.Split(host, ".")[0]).Msg("User not allowed to access resource")
 | 
								log.Warn().Str("user", userContext.Username).Str("resource", strings.Split(host, ".")[0]).Msg("User not allowed to access resource")
 | 
				
			||||||
@@ -194,7 +195,7 @@ func (controller *ProxyController) proxyHandler(c *gin.Context) {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if userContext.OAuth {
 | 
							if userContext.OAuth {
 | 
				
			||||||
			groupOK := controller.auth.IsInOAuthGroup(c, userContext, labels.OAuth.Groups)
 | 
								groupOK := controller.auth.IsInOAuthGroup(c, userContext, acls.OAuth.Groups)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if !groupOK {
 | 
								if !groupOK {
 | 
				
			||||||
				log.Warn().Str("user", userContext.Username).Str("resource", strings.Split(host, ".")[0]).Msg("User OAuth groups do not match resource requirements")
 | 
									log.Warn().Str("user", userContext.Username).Str("resource", strings.Split(host, ".")[0]).Msg("User OAuth groups do not match resource requirements")
 | 
				
			||||||
@@ -234,7 +235,7 @@ func (controller *ProxyController) proxyHandler(c *gin.Context) {
 | 
				
			|||||||
		c.Header("Remote-Email", utils.SanitizeHeader(userContext.Email))
 | 
							c.Header("Remote-Email", utils.SanitizeHeader(userContext.Email))
 | 
				
			||||||
		c.Header("Remote-Groups", utils.SanitizeHeader(userContext.OAuthGroups))
 | 
							c.Header("Remote-Groups", utils.SanitizeHeader(userContext.OAuthGroups))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		controller.setHeaders(c, labels)
 | 
							controller.setHeaders(c, acls)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		c.JSON(200, gin.H{
 | 
							c.JSON(200, gin.H{
 | 
				
			||||||
			"status":  200,
 | 
								"status":  200,
 | 
				
			||||||
@@ -264,21 +265,21 @@ func (controller *ProxyController) proxyHandler(c *gin.Context) {
 | 
				
			|||||||
	c.Redirect(http.StatusTemporaryRedirect, fmt.Sprintf("%s/login?%s", controller.config.AppURL, queries.Encode()))
 | 
						c.Redirect(http.StatusTemporaryRedirect, fmt.Sprintf("%s/login?%s", controller.config.AppURL, queries.Encode()))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (controller *ProxyController) setHeaders(c *gin.Context, labels config.App) {
 | 
					func (controller *ProxyController) setHeaders(c *gin.Context, acls config.App) {
 | 
				
			||||||
	c.Header("Authorization", c.Request.Header.Get("Authorization"))
 | 
						c.Header("Authorization", c.Request.Header.Get("Authorization"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	headers := utils.ParseHeaders(labels.Response.Headers)
 | 
						headers := utils.ParseHeaders(acls.Response.Headers)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for key, value := range headers {
 | 
						for key, value := range headers {
 | 
				
			||||||
		log.Debug().Str("header", key).Msg("Setting header")
 | 
							log.Debug().Str("header", key).Msg("Setting header")
 | 
				
			||||||
		c.Header(key, value)
 | 
							c.Header(key, value)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	basicPassword := utils.GetSecret(labels.Response.BasicAuth.Password, labels.Response.BasicAuth.PasswordFile)
 | 
						basicPassword := utils.GetSecret(acls.Response.BasicAuth.Password, acls.Response.BasicAuth.PasswordFile)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if labels.Response.BasicAuth.Username != "" && basicPassword != "" {
 | 
						if acls.Response.BasicAuth.Username != "" && basicPassword != "" {
 | 
				
			||||||
		log.Debug().Str("username", labels.Response.BasicAuth.Username).Msg("Setting basic auth header")
 | 
							log.Debug().Str("username", acls.Response.BasicAuth.Username).Msg("Setting basic auth header")
 | 
				
			||||||
		c.Header("Authorization", fmt.Sprintf("Basic %s", utils.GetBasicAuth(labels.Response.BasicAuth.Username, basicPassword)))
 | 
							c.Header("Authorization", fmt.Sprintf("Basic %s", utils.GetBasicAuth(acls.Response.BasicAuth.Username, basicPassword)))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,6 +39,11 @@ func setupProxyController(t *testing.T, middlewares *[]gin.HandlerFunc) (*gin.En
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	assert.NilError(t, dockerService.Init())
 | 
						assert.NilError(t, dockerService.Init())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Access controls
 | 
				
			||||||
 | 
						accessControlsService := service.NewAccessControlsService(dockerService)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						assert.NilError(t, accessControlsService.Init())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Auth service
 | 
						// Auth service
 | 
				
			||||||
	authService := service.NewAuthService(service.AuthServiceConfig{
 | 
						authService := service.NewAuthService(service.AuthServiceConfig{
 | 
				
			||||||
		Users: []config.User{
 | 
							Users: []config.User{
 | 
				
			||||||
@@ -59,7 +64,7 @@ func setupProxyController(t *testing.T, middlewares *[]gin.HandlerFunc) (*gin.En
 | 
				
			|||||||
	// Controller
 | 
						// Controller
 | 
				
			||||||
	ctrl := controller.NewProxyController(controller.ProxyControllerConfig{
 | 
						ctrl := controller.NewProxyController(controller.ProxyControllerConfig{
 | 
				
			||||||
		AppURL: "http://localhost:8080",
 | 
							AppURL: "http://localhost:8080",
 | 
				
			||||||
	}, group, dockerService, authService)
 | 
						}, group, accessControlsService, authService)
 | 
				
			||||||
	ctrl.SetupRoutes()
 | 
						ctrl.SetupRoutes()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return router, recorder, authService
 | 
						return router, recorder, authService
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										72
									
								
								internal/service/access_controls_service.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								internal/service/access_controls_service.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,72 @@
 | 
				
			|||||||
 | 
					package service
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"os"
 | 
				
			||||||
 | 
						"strings"
 | 
				
			||||||
 | 
						"tinyauth/internal/config"
 | 
				
			||||||
 | 
						"tinyauth/internal/utils"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/rs/zerolog/log"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type AccessControlsService struct {
 | 
				
			||||||
 | 
						docker   *DockerService
 | 
				
			||||||
 | 
						envACLs  config.Apps
 | 
				
			||||||
 | 
						aclFlags map[string]string
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func NewAccessControlsService(docker *DockerService) *AccessControlsService {
 | 
				
			||||||
 | 
						return &AccessControlsService{
 | 
				
			||||||
 | 
							docker:   docker,
 | 
				
			||||||
 | 
							aclFlags: make(map[string]string),
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (acls *AccessControlsService) SetACLFlags(flags map[string]string) {
 | 
				
			||||||
 | 
						acls.aclFlags = flags
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (acls *AccessControlsService) Init() error {
 | 
				
			||||||
 | 
						env := os.Environ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						apps, err := utils.GetACLsConfig(env, acls.aclFlags)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						acls.envACLs = apps
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (acls *AccessControlsService) lookupEnvACLs(appDomain string) *config.App {
 | 
				
			||||||
 | 
						if len(acls.envACLs.Apps) == 0 {
 | 
				
			||||||
 | 
							return nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for appName, appACLs := range acls.envACLs.Apps {
 | 
				
			||||||
 | 
							if appACLs.Config.Domain == appDomain {
 | 
				
			||||||
 | 
								return &appACLs
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if strings.SplitN(appDomain, ".", 2)[0] == appName {
 | 
				
			||||||
 | 
								return &appACLs
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (acls *AccessControlsService) GetAccessControls(appDomain string) (config.App, error) {
 | 
				
			||||||
 | 
						// First check environment variables
 | 
				
			||||||
 | 
						envACLs := acls.lookupEnvACLs(appDomain)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if envACLs != nil {
 | 
				
			||||||
 | 
							log.Debug().Str("domain", appDomain).Msg("Found matching access controls in environment variables")
 | 
				
			||||||
 | 
							return *envACLs, nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Fallback to Docker labels
 | 
				
			||||||
 | 
						return acls.docker.GetLabels(appDomain)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,6 +1,8 @@
 | 
				
			|||||||
package service
 | 
					package service
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"context"
 | 
				
			||||||
 | 
						"errors"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"regexp"
 | 
						"regexp"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
@@ -41,6 +43,7 @@ type AuthService struct {
 | 
				
			|||||||
	loginMutex    sync.RWMutex
 | 
						loginMutex    sync.RWMutex
 | 
				
			||||||
	ldap          *LdapService
 | 
						ldap          *LdapService
 | 
				
			||||||
	database      *gorm.DB
 | 
						database      *gorm.DB
 | 
				
			||||||
 | 
						ctx           context.Context
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func NewAuthService(config AuthServiceConfig, docker *DockerService, ldap *LdapService, database *gorm.DB) *AuthService {
 | 
					func NewAuthService(config AuthServiceConfig, docker *DockerService, ldap *LdapService, database *gorm.DB) *AuthService {
 | 
				
			||||||
@@ -54,6 +57,7 @@ func NewAuthService(config AuthServiceConfig, docker *DockerService, ldap *LdapS
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (auth *AuthService) Init() error {
 | 
					func (auth *AuthService) Init() error {
 | 
				
			||||||
 | 
						auth.ctx = context.Background()
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -213,7 +217,7 @@ func (auth *AuthService) CreateSessionCookie(c *gin.Context, data *config.Sessio
 | 
				
			|||||||
		OAuthName:   data.OAuthName,
 | 
							OAuthName:   data.OAuthName,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = auth.database.Create(&session).Error
 | 
						err = gorm.G[model.Session](auth.database).Create(auth.ctx, &session)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
@@ -231,10 +235,10 @@ func (auth *AuthService) DeleteSessionCookie(c *gin.Context) error {
 | 
				
			|||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	res := auth.database.Unscoped().Where("uuid = ?", cookie).Delete(&model.Session{})
 | 
						_, err = gorm.G[model.Session](auth.database).Where("uuid = ?", cookie).Delete(auth.ctx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if res.Error != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return res.Error
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	c.SetCookie(auth.config.SessionCookieName, "", -1, "/", fmt.Sprintf(".%s", auth.config.CookieDomain), auth.config.SecureCookie, true)
 | 
						c.SetCookie(auth.config.SessionCookieName, "", -1, "/", fmt.Sprintf(".%s", auth.config.CookieDomain), auth.config.SecureCookie, true)
 | 
				
			||||||
@@ -249,15 +253,13 @@ func (auth *AuthService) GetSessionCookie(c *gin.Context) (config.SessionCookie,
 | 
				
			|||||||
		return config.SessionCookie{}, err
 | 
							return config.SessionCookie{}, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var session model.Session
 | 
						session, err := gorm.G[model.Session](auth.database).Where("uuid = ?", cookie).First(auth.ctx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	res := auth.database.Unscoped().Where("uuid = ?", cookie).First(&session)
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return config.SessionCookie{}, err
 | 
				
			||||||
	if res.Error != nil {
 | 
					 | 
				
			||||||
		return config.SessionCookie{}, res.Error
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if res.RowsAffected == 0 {
 | 
						if errors.Is(err, gorm.ErrRecordNotFound) {
 | 
				
			||||||
		return config.SessionCookie{}, fmt.Errorf("session not found")
 | 
							return config.SessionCookie{}, fmt.Errorf("session not found")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -287,21 +289,21 @@ func (auth *AuthService) UserAuthConfigured() bool {
 | 
				
			|||||||
	return len(auth.config.Users) > 0 || auth.ldap != nil
 | 
						return len(auth.config.Users) > 0 || auth.ldap != nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (auth *AuthService) IsResourceAllowed(c *gin.Context, context config.UserContext, labels config.App) bool {
 | 
					func (auth *AuthService) IsResourceAllowed(c *gin.Context, context config.UserContext, acls config.App) bool {
 | 
				
			||||||
	if context.OAuth {
 | 
						if context.OAuth {
 | 
				
			||||||
		log.Debug().Msg("Checking OAuth whitelist")
 | 
							log.Debug().Msg("Checking OAuth whitelist")
 | 
				
			||||||
		return utils.CheckFilter(labels.OAuth.Whitelist, context.Email)
 | 
							return utils.CheckFilter(acls.OAuth.Whitelist, context.Email)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if labels.Users.Block != "" {
 | 
						if acls.Users.Block != "" {
 | 
				
			||||||
		log.Debug().Msg("Checking blocked users")
 | 
							log.Debug().Msg("Checking blocked users")
 | 
				
			||||||
		if utils.CheckFilter(labels.Users.Block, context.Username) {
 | 
							if utils.CheckFilter(acls.Users.Block, context.Username) {
 | 
				
			||||||
			return false
 | 
								return false
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	log.Debug().Msg("Checking users")
 | 
						log.Debug().Msg("Checking users")
 | 
				
			||||||
	return utils.CheckFilter(labels.Users.Allow, context.Username)
 | 
						return utils.CheckFilter(acls.Users.Allow, context.Username)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (auth *AuthService) IsInOAuthGroup(c *gin.Context, context config.UserContext, requiredGroups string) bool {
 | 
					func (auth *AuthService) IsInOAuthGroup(c *gin.Context, context config.UserContext, requiredGroups string) bool {
 | 
				
			||||||
@@ -369,8 +371,8 @@ func (auth *AuthService) GetBasicAuth(c *gin.Context) *config.User {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (auth *AuthService) CheckIP(labels config.AppIP, ip string) bool {
 | 
					func (auth *AuthService) CheckIP(acls config.AppIP, ip string) bool {
 | 
				
			||||||
	for _, blocked := range labels.Block {
 | 
						for _, blocked := range acls.Block {
 | 
				
			||||||
		res, err := utils.FilterIP(blocked, ip)
 | 
							res, err := utils.FilterIP(blocked, ip)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			log.Warn().Err(err).Str("item", blocked).Msg("Invalid IP/CIDR in block list")
 | 
								log.Warn().Err(err).Str("item", blocked).Msg("Invalid IP/CIDR in block list")
 | 
				
			||||||
@@ -382,7 +384,7 @@ func (auth *AuthService) CheckIP(labels config.AppIP, ip string) bool {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for _, allowed := range labels.Allow {
 | 
						for _, allowed := range acls.Allow {
 | 
				
			||||||
		res, err := utils.FilterIP(allowed, ip)
 | 
							res, err := utils.FilterIP(allowed, ip)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			log.Warn().Err(err).Str("item", allowed).Msg("Invalid IP/CIDR in allow list")
 | 
								log.Warn().Err(err).Str("item", allowed).Msg("Invalid IP/CIDR in allow list")
 | 
				
			||||||
@@ -394,7 +396,7 @@ func (auth *AuthService) CheckIP(labels config.AppIP, ip string) bool {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if len(labels.Allow) > 0 {
 | 
						if len(acls.Allow) > 0 {
 | 
				
			||||||
		log.Debug().Str("ip", ip).Msg("IP not in allow list, denying access")
 | 
							log.Debug().Str("ip", ip).Msg("IP not in allow list, denying access")
 | 
				
			||||||
		return false
 | 
							return false
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -403,8 +405,8 @@ func (auth *AuthService) CheckIP(labels config.AppIP, ip string) bool {
 | 
				
			|||||||
	return true
 | 
						return true
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (auth *AuthService) IsBypassedIP(labels config.AppIP, ip string) bool {
 | 
					func (auth *AuthService) IsBypassedIP(acls config.AppIP, ip string) bool {
 | 
				
			||||||
	for _, bypassed := range labels.Bypass {
 | 
						for _, bypassed := range acls.Bypass {
 | 
				
			||||||
		res, err := utils.FilterIP(bypassed, ip)
 | 
							res, err := utils.FilterIP(bypassed, ip)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			log.Warn().Err(err).Str("item", bypassed).Msg("Invalid IP/CIDR in bypass list")
 | 
								log.Warn().Err(err).Str("item", bypassed).Msg("Invalid IP/CIDR in bypass list")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -59,10 +59,8 @@ func (generic *GenericOAuthService) Init() error {
 | 
				
			|||||||
	ctx := context.Background()
 | 
						ctx := context.Background()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ctx = context.WithValue(ctx, oauth2.HTTPClient, httpClient)
 | 
						ctx = context.WithValue(ctx, oauth2.HTTPClient, httpClient)
 | 
				
			||||||
	verifier := oauth2.GenerateVerifier()
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	generic.context = ctx
 | 
						generic.context = ctx
 | 
				
			||||||
	generic.verifier = verifier
 | 
					 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -76,6 +74,12 @@ func (generic *GenericOAuthService) GenerateState() string {
 | 
				
			|||||||
	return state
 | 
						return state
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (generic *GenericOAuthService) GenerateVerifier() string {
 | 
				
			||||||
 | 
						verifier := oauth2.GenerateVerifier()
 | 
				
			||||||
 | 
						generic.verifier = verifier
 | 
				
			||||||
 | 
						return verifier
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (generic *GenericOAuthService) GetAuthURL(state string) string {
 | 
					func (generic *GenericOAuthService) GetAuthURL(state string) string {
 | 
				
			||||||
	return generic.config.AuthCodeURL(state, oauth2.AccessTypeOffline, oauth2.S256ChallengeOption(generic.verifier))
 | 
						return generic.config.AuthCodeURL(state, oauth2.AccessTypeOffline, oauth2.S256ChallengeOption(generic.verifier))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -53,10 +53,7 @@ func (github *GithubOAuthService) Init() error {
 | 
				
			|||||||
	httpClient := &http.Client{}
 | 
						httpClient := &http.Client{}
 | 
				
			||||||
	ctx := context.Background()
 | 
						ctx := context.Background()
 | 
				
			||||||
	ctx = context.WithValue(ctx, oauth2.HTTPClient, httpClient)
 | 
						ctx = context.WithValue(ctx, oauth2.HTTPClient, httpClient)
 | 
				
			||||||
	verifier := oauth2.GenerateVerifier()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	github.context = ctx
 | 
						github.context = ctx
 | 
				
			||||||
	github.verifier = verifier
 | 
					 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -70,6 +67,12 @@ func (github *GithubOAuthService) GenerateState() string {
 | 
				
			|||||||
	return state
 | 
						return state
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (github *GithubOAuthService) GenerateVerifier() string {
 | 
				
			||||||
 | 
						verifier := oauth2.GenerateVerifier()
 | 
				
			||||||
 | 
						github.verifier = verifier
 | 
				
			||||||
 | 
						return verifier
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (github *GithubOAuthService) GetAuthURL(state string) string {
 | 
					func (github *GithubOAuthService) GetAuthURL(state string) string {
 | 
				
			||||||
	return github.config.AuthCodeURL(state, oauth2.AccessTypeOffline, oauth2.S256ChallengeOption(github.verifier))
 | 
						return github.config.AuthCodeURL(state, oauth2.AccessTypeOffline, oauth2.S256ChallengeOption(github.verifier))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,10 +48,7 @@ func (google *GoogleOAuthService) Init() error {
 | 
				
			|||||||
	httpClient := &http.Client{}
 | 
						httpClient := &http.Client{}
 | 
				
			||||||
	ctx := context.Background()
 | 
						ctx := context.Background()
 | 
				
			||||||
	ctx = context.WithValue(ctx, oauth2.HTTPClient, httpClient)
 | 
						ctx = context.WithValue(ctx, oauth2.HTTPClient, httpClient)
 | 
				
			||||||
	verifier := oauth2.GenerateVerifier()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	google.context = ctx
 | 
						google.context = ctx
 | 
				
			||||||
	google.verifier = verifier
 | 
					 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -65,6 +62,12 @@ func (oauth *GoogleOAuthService) GenerateState() string {
 | 
				
			|||||||
	return state
 | 
						return state
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (google *GoogleOAuthService) GenerateVerifier() string {
 | 
				
			||||||
 | 
						verifier := oauth2.GenerateVerifier()
 | 
				
			||||||
 | 
						google.verifier = verifier
 | 
				
			||||||
 | 
						return verifier
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (google *GoogleOAuthService) GetAuthURL(state string) string {
 | 
					func (google *GoogleOAuthService) GetAuthURL(state string) string {
 | 
				
			||||||
	return google.config.AuthCodeURL(state, oauth2.AccessTypeOffline, oauth2.S256ChallengeOption(google.verifier))
 | 
						return google.config.AuthCodeURL(state, oauth2.AccessTypeOffline, oauth2.S256ChallengeOption(google.verifier))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,7 @@ import (
 | 
				
			|||||||
type OAuthService interface {
 | 
					type OAuthService interface {
 | 
				
			||||||
	Init() error
 | 
						Init() error
 | 
				
			||||||
	GenerateState() string
 | 
						GenerateState() string
 | 
				
			||||||
 | 
						GenerateVerifier() string
 | 
				
			||||||
	GetAuthURL(state string) string
 | 
						GetAuthURL(state string) string
 | 
				
			||||||
	VerifyCode(code string) error
 | 
						VerifyCode(code string) error
 | 
				
			||||||
	Userinfo() (config.Claims, error)
 | 
						Userinfo() (config.Claims, error)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -147,7 +147,7 @@ func GetOAuthProvidersConfig(env []string, args []string, appUrl string) (map[st
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	envProviders, err := decoders.DecodeEnv(envMap)
 | 
						envProviders, err := decoders.DecodeEnv[config.Providers, config.OAuthServiceConfig](envMap, "providers")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
@@ -167,7 +167,7 @@ func GetOAuthProvidersConfig(env []string, args []string, appUrl string) (map[st
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	flagProviders, err := decoders.DecodeFlags(flagsMap)
 | 
						flagProviders, err := decoders.DecodeFlags[config.Providers, config.OAuthServiceConfig](flagsMap, "providers")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
@@ -208,3 +208,53 @@ func GetOAuthProvidersConfig(env []string, args []string, appUrl string) (map[st
 | 
				
			|||||||
	// Return combined providers
 | 
						// Return combined providers
 | 
				
			||||||
	return providers, nil
 | 
						return providers, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func GetACLsConfig(env []string, flagsMap map[string]string) (config.Apps, error) {
 | 
				
			||||||
 | 
						apps := config.Apps{Apps: make(map[string]config.App)}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						envMap := make(map[string]string)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for _, e := range env {
 | 
				
			||||||
 | 
							pair := strings.SplitN(e, "=", 2)
 | 
				
			||||||
 | 
							if len(pair) == 2 {
 | 
				
			||||||
 | 
								envMap[pair[0]] = pair[1]
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						envApps, err := decoders.DecodeACLEnv[config.Apps](envMap, "apps")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return config.Apps{}, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if envApps.Apps != nil {
 | 
				
			||||||
 | 
							maps.Copy(apps.Apps, envApps.Apps)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						flagApps, err := decoders.DecodeACLFlags[config.Apps](flagsMap, "apps")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return config.Apps{}, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if flagApps.Apps != nil {
 | 
				
			||||||
 | 
							maps.Copy(apps.Apps, flagApps.Apps)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return apps, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func ExtractACLFlags(args []string) map[string]string {
 | 
				
			||||||
 | 
						aclFlags := make(map[string]string)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for _, arg := range args {
 | 
				
			||||||
 | 
							if strings.HasPrefix(arg, "--apps-") || strings.HasPrefix(arg, "--tinyauth-apps-") {
 | 
				
			||||||
 | 
								pair := strings.SplitN(arg[2:], "=", 2)
 | 
				
			||||||
 | 
								if len(pair) == 2 {
 | 
				
			||||||
 | 
									aclFlags[pair[0]] = pair[1]
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return aclFlags
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,29 +3,89 @@ package decoders
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"reflect"
 | 
						"reflect"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"tinyauth/internal/config"
 | 
					
 | 
				
			||||||
 | 
						"github.com/stoewer/go-strcase"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func NormalizeKeys(keys map[string]string, rootName string, sep string) map[string]string {
 | 
					func ParsePath(parts []string, idx int, t reflect.Type) []string {
 | 
				
			||||||
	normalized := make(map[string]string)
 | 
						if idx >= len(parts) {
 | 
				
			||||||
	knownKeys := getKnownKeys()
 | 
							return []string{}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for k, v := range keys {
 | 
						if t.Kind() == reflect.Map {
 | 
				
			||||||
		var finalKey []string
 | 
					 | 
				
			||||||
		var suffix string
 | 
					 | 
				
			||||||
		var camelClientName string
 | 
					 | 
				
			||||||
		var camelField string
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		finalKey = append(finalKey, rootName)
 | 
							if idx >= len(parts) {
 | 
				
			||||||
		finalKey = append(finalKey, "providers")
 | 
								return []string{}
 | 
				
			||||||
		lowerKey := strings.ToLower(k)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if !strings.HasPrefix(lowerKey, "providers"+sep) {
 | 
					 | 
				
			||||||
			continue
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							elemType := t.Elem()
 | 
				
			||||||
 | 
							keyEndIdx := idx + 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if elemType.Kind() == reflect.Struct {
 | 
				
			||||||
 | 
								for i := idx + 1; i < len(parts); i++ {
 | 
				
			||||||
 | 
									found := false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									for j := 0; j < elemType.NumField(); j++ {
 | 
				
			||||||
 | 
										field := elemType.Field(j)
 | 
				
			||||||
 | 
										if strings.EqualFold(parts[i], field.Name) {
 | 
				
			||||||
 | 
											keyEndIdx = i
 | 
				
			||||||
 | 
											found = true
 | 
				
			||||||
 | 
											break
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									if found {
 | 
				
			||||||
 | 
										break
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							keyParts := parts[idx:keyEndIdx]
 | 
				
			||||||
 | 
							keyName := strings.ToLower(strings.Join(keyParts, "_"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							rest := ParsePath(parts, keyEndIdx, elemType)
 | 
				
			||||||
 | 
							result := append([]string{keyName}, rest...)
 | 
				
			||||||
 | 
							return result
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if t.Kind() == reflect.Struct {
 | 
				
			||||||
 | 
							for i := 0; i < t.NumField(); i++ {
 | 
				
			||||||
 | 
								field := t.Field(i)
 | 
				
			||||||
 | 
								if field.Type.Kind() == reflect.Map {
 | 
				
			||||||
 | 
									rest := ParsePath(parts, idx, field.Type)
 | 
				
			||||||
 | 
									if len(rest) > 0 {
 | 
				
			||||||
 | 
										return rest
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							for i := 0; i < t.NumField(); i++ {
 | 
				
			||||||
 | 
								field := t.Field(i)
 | 
				
			||||||
 | 
								if strings.EqualFold(parts[idx], field.Name) {
 | 
				
			||||||
 | 
									rest := ParsePath(parts, idx+1, field.Type)
 | 
				
			||||||
 | 
									result := append([]string{strings.ToLower(field.Name)}, rest...)
 | 
				
			||||||
 | 
									return result
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return []string{}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func normalizeKeys[T any](input map[string]string, root string, sep string) map[string]string {
 | 
				
			||||||
 | 
						knownKeys := getKnownKeys[T]()
 | 
				
			||||||
 | 
						normalized := make(map[string]string)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for k, v := range input {
 | 
				
			||||||
 | 
							parts := []string{"tinyauth"}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							key := strings.ToLower(k)
 | 
				
			||||||
 | 
							key = strings.ReplaceAll(key, sep, "-")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							suffix := ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for _, known := range knownKeys {
 | 
							for _, known := range knownKeys {
 | 
				
			||||||
			if strings.HasSuffix(lowerKey, strings.ReplaceAll(known, "-", sep)) {
 | 
								if strings.HasSuffix(key, known) {
 | 
				
			||||||
				suffix = known
 | 
									suffix = known
 | 
				
			||||||
				break
 | 
									break
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
@@ -35,55 +95,101 @@ func NormalizeKeys(keys map[string]string, rootName string, sep string) map[stri
 | 
				
			|||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if strings.TrimSpace(strings.TrimSuffix(strings.TrimPrefix(lowerKey, "providers"+sep), strings.ReplaceAll(suffix, "-", sep))) == "" {
 | 
							parts = append(parts, root)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							id := strings.TrimPrefix(key, root+"-")
 | 
				
			||||||
 | 
							id = strings.TrimSuffix(id, "-"+suffix)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if id == "" {
 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		clientNameParts := strings.Split(strings.TrimPrefix(strings.TrimSuffix(lowerKey, sep+strings.ReplaceAll(suffix, "-", sep)), "providers"+sep), sep)
 | 
							parts = append(parts, id)
 | 
				
			||||||
 | 
							parts = append(parts, suffix)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for i, p := range clientNameParts {
 | 
							final := ""
 | 
				
			||||||
			if i == 0 {
 | 
					
 | 
				
			||||||
				camelClientName += p
 | 
							for i, part := range parts {
 | 
				
			||||||
				continue
 | 
								if i > 0 {
 | 
				
			||||||
 | 
									final += "."
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if p == "" {
 | 
								final += strcase.LowerCamelCase(part)
 | 
				
			||||||
				continue
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			camelClientName += strings.ToUpper(string([]rune(p)[0])) + string([]rune(p)[1:])
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		finalKey = append(finalKey, camelClientName)
 | 
							normalized[final] = v
 | 
				
			||||||
 | 
					 | 
				
			||||||
		fieldParts := strings.Split(suffix, "-")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		for i, p := range fieldParts {
 | 
					 | 
				
			||||||
			if i == 0 {
 | 
					 | 
				
			||||||
				camelField += p
 | 
					 | 
				
			||||||
				continue
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			if p == "" {
 | 
					 | 
				
			||||||
				continue
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			camelField += strings.ToUpper(string([]rune(p)[0])) + string([]rune(p)[1:])
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		finalKey = append(finalKey, camelField)
 | 
					 | 
				
			||||||
		normalized[strings.Join(finalKey, ".")] = v
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return normalized
 | 
						return normalized
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func getKnownKeys() []string {
 | 
					func getKnownKeys[T any]() []string {
 | 
				
			||||||
	var known []string
 | 
						var keys []string
 | 
				
			||||||
 | 
						var t T
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	p := config.OAuthServiceConfig{}
 | 
						v := reflect.ValueOf(t)
 | 
				
			||||||
	v := reflect.ValueOf(p)
 | 
						typeOfT := v.Type()
 | 
				
			||||||
	typeOfP := v.Type()
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for field := range typeOfP.NumField() {
 | 
						for field := range typeOfT.NumField() {
 | 
				
			||||||
		known = append(known, typeOfP.Field(field).Tag.Get("key"))
 | 
							if typeOfT.Field(field).Tag.Get("field") != "" {
 | 
				
			||||||
 | 
								keys = append(keys, typeOfT.Field(field).Tag.Get("field"))
 | 
				
			||||||
 | 
								continue
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							keys = append(keys, strcase.KebabCase(typeOfT.Field(field).Name))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return known
 | 
						return keys
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func normalizeACLKeys[T any](input map[string]string, root string, sep string) map[string]string {
 | 
				
			||||||
 | 
						normalized := make(map[string]string)
 | 
				
			||||||
 | 
						var t T
 | 
				
			||||||
 | 
						rootType := reflect.TypeOf(t)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for k, v := range input {
 | 
				
			||||||
 | 
							parts := strings.Split(strings.ToLower(k), sep)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if len(parts) < 2 {
 | 
				
			||||||
 | 
								continue
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Two cases:
 | 
				
			||||||
 | 
							// 1. Keys starting with "tinyauth" (env vars): tinyauth_apps_...
 | 
				
			||||||
 | 
							// 2. Keys starting with root directly (flags): apps-...
 | 
				
			||||||
 | 
							startIdx := 0
 | 
				
			||||||
 | 
							if parts[0] == "tinyauth" {
 | 
				
			||||||
 | 
								if len(parts) < 3 {
 | 
				
			||||||
 | 
									continue
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if parts[1] != root {
 | 
				
			||||||
 | 
									continue
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								startIdx = 2 // Skip "tinyauth" and root
 | 
				
			||||||
 | 
							} else if parts[0] == root {
 | 
				
			||||||
 | 
								startIdx = 1 // Skip root only
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								continue
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if startIdx < len(parts) {
 | 
				
			||||||
 | 
								parsedParts := ParsePath(parts[startIdx:], 0, rootType)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if len(parsedParts) == 0 {
 | 
				
			||||||
 | 
									continue
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								final := "tinyauth." + root
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								for _, part := range parsedParts {
 | 
				
			||||||
 | 
									if strings.Contains(part, "_") {
 | 
				
			||||||
 | 
										final += "." + part
 | 
				
			||||||
 | 
									} else {
 | 
				
			||||||
 | 
										final += "." + strcase.LowerCamelCase(part)
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								normalized[final] = v
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return normalized
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,49 +0,0 @@
 | 
				
			|||||||
package decoders_test
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"testing"
 | 
					 | 
				
			||||||
	"tinyauth/internal/utils/decoders"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	"gotest.tools/v3/assert"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func TestNormalizeKeys(t *testing.T) {
 | 
					 | 
				
			||||||
	// Test with env
 | 
					 | 
				
			||||||
	test := map[string]string{
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT1_CLIENT_ID":                    "my-client-id",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT1_CLIENT_SECRET":                "my-client-secret",
 | 
					 | 
				
			||||||
		"PROVIDERS_MY_AWESOME_CLIENT_CLIENT_ID":          "my-awesome-client-id",
 | 
					 | 
				
			||||||
		"PROVIDERS_MY_AWESOME_CLIENT_CLIENT_SECRET_FILE": "/path/to/secret",
 | 
					 | 
				
			||||||
		"I_LOOK_LIKE_A_KEY_CLIENT_ID":                    "should-not-appear",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT_ID":                            "should-not-appear",
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	expected := map[string]string{
 | 
					 | 
				
			||||||
		"tinyauth.providers.client1.clientId":                 "my-client-id",
 | 
					 | 
				
			||||||
		"tinyauth.providers.client1.clientSecret":             "my-client-secret",
 | 
					 | 
				
			||||||
		"tinyauth.providers.myAwesomeClient.clientId":         "my-awesome-client-id",
 | 
					 | 
				
			||||||
		"tinyauth.providers.myAwesomeClient.clientSecretFile": "/path/to/secret",
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	normalized := decoders.NormalizeKeys(test, "tinyauth", "_")
 | 
					 | 
				
			||||||
	assert.DeepEqual(t, normalized, expected)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// Test with flags (assume -- is already stripped)
 | 
					 | 
				
			||||||
	test = map[string]string{
 | 
					 | 
				
			||||||
		"providers-client1-client-id":                    "my-client-id",
 | 
					 | 
				
			||||||
		"providers-client1-client-secret":                "my-client-secret",
 | 
					 | 
				
			||||||
		"providers-my-awesome-client-client-id":          "my-awesome-client-id",
 | 
					 | 
				
			||||||
		"providers-my-awesome-client-client-secret-file": "/path/to/secret",
 | 
					 | 
				
			||||||
		"providers-should-not-appear-client":             "should-not-appear",
 | 
					 | 
				
			||||||
		"i-look-like-a-key-client-id":                    "should-not-appear",
 | 
					 | 
				
			||||||
		"providers-client-id":                            "should-not-appear",
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	expected = map[string]string{
 | 
					 | 
				
			||||||
		"tinyauth.providers.client1.clientId":                 "my-client-id",
 | 
					 | 
				
			||||||
		"tinyauth.providers.client1.clientSecret":             "my-client-secret",
 | 
					 | 
				
			||||||
		"tinyauth.providers.myAwesomeClient.clientId":         "my-awesome-client-id",
 | 
					 | 
				
			||||||
		"tinyauth.providers.myAwesomeClient.clientSecretFile": "/path/to/secret",
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	normalized = decoders.NormalizeKeys(test, "tinyauth", "-")
 | 
					 | 
				
			||||||
	assert.DeepEqual(t, normalized, expected)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,20 +1,33 @@
 | 
				
			|||||||
package decoders
 | 
					package decoders
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"tinyauth/internal/config"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	"github.com/traefik/paerser/parser"
 | 
						"github.com/traefik/paerser/parser"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func DecodeEnv(env map[string]string) (config.Providers, error) {
 | 
					func DecodeEnv[T any, C any](env map[string]string, subName string) (T, error) {
 | 
				
			||||||
	normalized := NormalizeKeys(env, "tinyauth", "_")
 | 
						var result T
 | 
				
			||||||
	var providers config.Providers
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err := parser.Decode(normalized, &providers, "tinyauth", "tinyauth.providers")
 | 
						normalized := normalizeKeys[C](env, subName, "_")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						err := parser.Decode(normalized, &result, "tinyauth", "tinyauth."+subName)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return config.Providers{}, err
 | 
							return result, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return providers, nil
 | 
						return result, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func DecodeACLEnv[T any](env map[string]string, subName string) (T, error) {
 | 
				
			||||||
 | 
						var result T
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						normalized := normalizeACLKeys[T](env, subName, "_")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						err := parser.Decode(normalized, &result, "tinyauth", "tinyauth."+subName)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return result, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return result, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,52 +9,29 @@ import (
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestDecodeEnv(t *testing.T) {
 | 
					func TestDecodeEnv(t *testing.T) {
 | 
				
			||||||
	// Variables
 | 
						// Setup
 | 
				
			||||||
 | 
						env := map[string]string{
 | 
				
			||||||
 | 
							"PROVIDERS_GOOGLE_CLIENT_ID":        "google-client-id",
 | 
				
			||||||
 | 
							"PROVIDERS_GOOGLE_CLIENT_SECRET":    "google-client-secret",
 | 
				
			||||||
 | 
							"PROVIDERS_MY_GITHUB_CLIENT_ID":     "github-client-id",
 | 
				
			||||||
 | 
							"PROVIDERS_MY_GITHUB_CLIENT_SECRET": "github-client-secret",
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	expected := config.Providers{
 | 
						expected := config.Providers{
 | 
				
			||||||
		Providers: map[string]config.OAuthServiceConfig{
 | 
							Providers: map[string]config.OAuthServiceConfig{
 | 
				
			||||||
			"client1": {
 | 
								"google": {
 | 
				
			||||||
				ClientID:           "client1-id",
 | 
									ClientID:     "google-client-id",
 | 
				
			||||||
				ClientSecret:       "client1-secret",
 | 
									ClientSecret: "google-client-secret",
 | 
				
			||||||
				Scopes:             []string{"client1-scope1", "client1-scope2"},
 | 
					 | 
				
			||||||
				RedirectURL:        "client1-redirect-url",
 | 
					 | 
				
			||||||
				AuthURL:            "client1-auth-url",
 | 
					 | 
				
			||||||
				UserinfoURL:        "client1-user-info-url",
 | 
					 | 
				
			||||||
				Name:               "Client1",
 | 
					 | 
				
			||||||
				InsecureSkipVerify: false,
 | 
					 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			"client2": {
 | 
								"myGithub": {
 | 
				
			||||||
				ClientID:           "client2-id",
 | 
									ClientID:     "github-client-id",
 | 
				
			||||||
				ClientSecret:       "client2-secret",
 | 
									ClientSecret: "github-client-secret",
 | 
				
			||||||
				Scopes:             []string{"client2-scope1", "client2-scope2"},
 | 
					 | 
				
			||||||
				RedirectURL:        "client2-redirect-url",
 | 
					 | 
				
			||||||
				AuthURL:            "client2-auth-url",
 | 
					 | 
				
			||||||
				UserinfoURL:        "client2-user-info-url",
 | 
					 | 
				
			||||||
				Name:               "My Awesome Client2",
 | 
					 | 
				
			||||||
				InsecureSkipVerify: false,
 | 
					 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	test := map[string]string{
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT1_CLIENT_ID":            "client1-id",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT1_CLIENT_SECRET":        "client1-secret",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT1_SCOPES":               "client1-scope1,client1-scope2",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT1_REDIRECT_URL":         "client1-redirect-url",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT1_AUTH_URL":             "client1-auth-url",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT1_USER_INFO_URL":        "client1-user-info-url",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT1_NAME":                 "Client1",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT1_INSECURE_SKIP_VERIFY": "false",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT2_CLIENT_ID":            "client2-id",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT2_CLIENT_SECRET":        "client2-secret",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT2_SCOPES":               "client2-scope1,client2-scope2",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT2_REDIRECT_URL":         "client2-redirect-url",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT2_AUTH_URL":             "client2-auth-url",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT2_USER_INFO_URL":        "client2-user-info-url",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT2_NAME":                 "My Awesome Client2",
 | 
					 | 
				
			||||||
		"PROVIDERS_CLIENT2_INSECURE_SKIP_VERIFY": "false",
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Test
 | 
						// Execute
 | 
				
			||||||
	res, err := decoders.DecodeEnv(test)
 | 
						result, err := decoders.DecodeEnv[config.Providers, config.OAuthServiceConfig](env, "providers")
 | 
				
			||||||
	assert.NilError(t, err)
 | 
						assert.NilError(t, err)
 | 
				
			||||||
	assert.DeepEqual(t, expected, res)
 | 
						assert.DeepEqual(t, result, expected)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,23 +2,38 @@ package decoders
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"tinyauth/internal/config"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/traefik/paerser/parser"
 | 
						"github.com/traefik/paerser/parser"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func DecodeFlags(flags map[string]string) (config.Providers, error) {
 | 
					func DecodeFlags[T any, C any](flags map[string]string, subName string) (T, error) {
 | 
				
			||||||
	filtered := filterFlags(flags)
 | 
						var result T
 | 
				
			||||||
	normalized := NormalizeKeys(filtered, "tinyauth", "-")
 | 
					 | 
				
			||||||
	var providers config.Providers
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err := parser.Decode(normalized, &providers, "tinyauth", "tinyauth.providers")
 | 
						filtered := filterFlags(flags)
 | 
				
			||||||
 | 
						normalized := normalizeKeys[C](filtered, subName, "_")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						err := parser.Decode(normalized, &result, "tinyauth", "tinyauth."+subName)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return config.Providers{}, err
 | 
							return result, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return providers, nil
 | 
						return result, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func DecodeACLFlags[T any](flags map[string]string, subName string) (T, error) {
 | 
				
			||||||
 | 
						var result T
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						filtered := filterFlags(flags)
 | 
				
			||||||
 | 
						normalized := normalizeACLKeys[T](filtered, subName, "-")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						err := parser.Decode(normalized, &result, "tinyauth", "tinyauth."+subName)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return result, err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return result, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func filterFlags(flags map[string]string) map[string]string {
 | 
					func filterFlags(flags map[string]string) map[string]string {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,52 +9,29 @@ import (
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestDecodeFlags(t *testing.T) {
 | 
					func TestDecodeFlags(t *testing.T) {
 | 
				
			||||||
	// Variables
 | 
						// Setup
 | 
				
			||||||
 | 
						flags := map[string]string{
 | 
				
			||||||
 | 
							"--providers-google-client-id":        "google-client-id",
 | 
				
			||||||
 | 
							"--providers-google-client-secret":    "google-client-secret",
 | 
				
			||||||
 | 
							"--providers-my-github-client-id":     "github-client-id",
 | 
				
			||||||
 | 
							"--providers-my-github-client-secret": "github-client-secret",
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	expected := config.Providers{
 | 
						expected := config.Providers{
 | 
				
			||||||
		Providers: map[string]config.OAuthServiceConfig{
 | 
							Providers: map[string]config.OAuthServiceConfig{
 | 
				
			||||||
			"client1": {
 | 
								"google": {
 | 
				
			||||||
				ClientID:           "client1-id",
 | 
									ClientID:     "google-client-id",
 | 
				
			||||||
				ClientSecret:       "client1-secret",
 | 
									ClientSecret: "google-client-secret",
 | 
				
			||||||
				Scopes:             []string{"client1-scope1", "client1-scope2"},
 | 
					 | 
				
			||||||
				RedirectURL:        "client1-redirect-url",
 | 
					 | 
				
			||||||
				AuthURL:            "client1-auth-url",
 | 
					 | 
				
			||||||
				UserinfoURL:        "client1-user-info-url",
 | 
					 | 
				
			||||||
				Name:               "Client1",
 | 
					 | 
				
			||||||
				InsecureSkipVerify: false,
 | 
					 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			"client2": {
 | 
								"myGithub": {
 | 
				
			||||||
				ClientID:           "client2-id",
 | 
									ClientID:     "github-client-id",
 | 
				
			||||||
				ClientSecret:       "client2-secret",
 | 
									ClientSecret: "github-client-secret",
 | 
				
			||||||
				Scopes:             []string{"client2-scope1", "client2-scope2"},
 | 
					 | 
				
			||||||
				RedirectURL:        "client2-redirect-url",
 | 
					 | 
				
			||||||
				AuthURL:            "client2-auth-url",
 | 
					 | 
				
			||||||
				UserinfoURL:        "client2-user-info-url",
 | 
					 | 
				
			||||||
				Name:               "My Awesome Client2",
 | 
					 | 
				
			||||||
				InsecureSkipVerify: false,
 | 
					 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	test := map[string]string{
 | 
					 | 
				
			||||||
		"--providers-client1-client-id":            "client1-id",
 | 
					 | 
				
			||||||
		"--providers-client1-client-secret":        "client1-secret",
 | 
					 | 
				
			||||||
		"--providers-client1-scopes":               "client1-scope1,client1-scope2",
 | 
					 | 
				
			||||||
		"--providers-client1-redirect-url":         "client1-redirect-url",
 | 
					 | 
				
			||||||
		"--providers-client1-auth-url":             "client1-auth-url",
 | 
					 | 
				
			||||||
		"--providers-client1-user-info-url":        "client1-user-info-url",
 | 
					 | 
				
			||||||
		"--providers-client1-name":                 "Client1",
 | 
					 | 
				
			||||||
		"--providers-client1-insecure-skip-verify": "false",
 | 
					 | 
				
			||||||
		"--providers-client2-client-id":            "client2-id",
 | 
					 | 
				
			||||||
		"--providers-client2-client-secret":        "client2-secret",
 | 
					 | 
				
			||||||
		"--providers-client2-scopes":               "client2-scope1,client2-scope2",
 | 
					 | 
				
			||||||
		"--providers-client2-redirect-url":         "client2-redirect-url",
 | 
					 | 
				
			||||||
		"--providers-client2-auth-url":             "client2-auth-url",
 | 
					 | 
				
			||||||
		"--providers-client2-user-info-url":        "client2-user-info-url",
 | 
					 | 
				
			||||||
		"--providers-client2-name":                 "My Awesome Client2",
 | 
					 | 
				
			||||||
		"--providers-client2-insecure-skip-verify": "false",
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Test
 | 
						// Execute
 | 
				
			||||||
	res, err := decoders.DecodeFlags(test)
 | 
						result, err := decoders.DecodeFlags[config.Providers, config.OAuthServiceConfig](flags, "providers")
 | 
				
			||||||
	assert.NilError(t, err)
 | 
						assert.NilError(t, err)
 | 
				
			||||||
	assert.DeepEqual(t, expected, res)
 | 
						assert.DeepEqual(t, result, expected)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user