mirror of
				https://github.com/steveiliop56/tinyauth.git
				synced 2025-10-31 06:05:43 +00:00 
			
		
		
		
	Compare commits
	
		
			7 Commits
		
	
	
		
			v3.6.2-bet
			...
			v3.6.2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 5f7f88421e | ||
|   | bc941cb248 | ||
|   | 00d15de44f | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | a4f17de0d1 | ||
|   | 6867667de6 | ||
|   | 079886b54c | ||
|   | 19eb8f3064 | 
| @@ -26,7 +26,7 @@ | |||||||
|         "react-hook-form": "^7.60.0", |         "react-hook-form": "^7.60.0", | ||||||
|         "react-i18next": "^15.6.0", |         "react-i18next": "^15.6.0", | ||||||
|         "react-markdown": "^10.1.0", |         "react-markdown": "^10.1.0", | ||||||
|         "react-router": "^7.6.3", |         "react-router": "^7.7.0", | ||||||
|         "sonner": "^2.0.6", |         "sonner": "^2.0.6", | ||||||
|         "tailwind-merge": "^3.3.1", |         "tailwind-merge": "^3.3.1", | ||||||
|         "tailwindcss": "^4.1.11", |         "tailwindcss": "^4.1.11", | ||||||
| @@ -47,7 +47,7 @@ | |||||||
|         "tw-animate-css": "^1.3.5", |         "tw-animate-css": "^1.3.5", | ||||||
|         "typescript": "~5.8.3", |         "typescript": "~5.8.3", | ||||||
|         "typescript-eslint": "^8.37.0", |         "typescript-eslint": "^8.37.0", | ||||||
|         "vite": "^7.0.4", |         "vite": "^7.0.5", | ||||||
|       }, |       }, | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
| @@ -804,7 +804,7 @@ | |||||||
|  |  | ||||||
|     "react-remove-scroll-bar": ["react-remove-scroll-bar@2.3.8", "", { "dependencies": { "react-style-singleton": "^2.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "optionalPeers": ["@types/react"] }, "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q=="], |     "react-remove-scroll-bar": ["react-remove-scroll-bar@2.3.8", "", { "dependencies": { "react-style-singleton": "^2.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "optionalPeers": ["@types/react"] }, "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q=="], | ||||||
|  |  | ||||||
|     "react-router": ["react-router@7.6.3", "", { "dependencies": { "cookie": "^1.0.1", "set-cookie-parser": "^2.6.0" }, "peerDependencies": { "react": ">=18", "react-dom": ">=18" }, "optionalPeers": ["react-dom"] }, "sha512-zf45LZp5skDC6I3jDLXQUu0u26jtuP4lEGbc7BbdyxenBN1vJSTA18czM2D+h5qyMBuMrD+9uB+mU37HIoKGRA=="], |     "react-router": ["react-router@7.7.0", "", { "dependencies": { "cookie": "^1.0.1", "set-cookie-parser": "^2.6.0" }, "peerDependencies": { "react": ">=18", "react-dom": ">=18" }, "optionalPeers": ["react-dom"] }, "sha512-3FUYSwlvB/5wRJVTL/aavqHmfUKe0+Xm9MllkYgGo9eDwNdkvwlJGjpPxono1kCycLt6AnDTgjmXvK3/B4QGuw=="], | ||||||
|  |  | ||||||
|     "react-style-singleton": ["react-style-singleton@2.2.3", "", { "dependencies": { "get-nonce": "^1.0.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ=="], |     "react-style-singleton": ["react-style-singleton@2.2.3", "", { "dependencies": { "get-nonce": "^1.0.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ=="], | ||||||
|  |  | ||||||
| @@ -900,7 +900,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.0.4", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.6", "picomatch": "^4.0.2", "postcss": "^8.5.6", "rollup": "^4.40.0", "tinyglobby": "^0.2.14" }, "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-SkaSguuS7nnmV7mfJ8l81JGBFV7Gvzp8IzgE8A8t23+AxuNX61Q5H1Tpz5efduSN7NHC8nQXD3sKQKZAu5mNEA=="], |     "vite": ["vite@7.0.5", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.6", "picomatch": "^4.0.2", "postcss": "^8.5.6", "rollup": "^4.40.0", "tinyglobby": "^0.2.14" }, "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-1mncVwJxy2C9ThLwz0+2GKZyEXuC3MyWtAAlNftlZZXZDP3AJt5FmwcMit/IGGaNZ8ZOB2BNO/HFUB+CpN0NQw=="], | ||||||
|  |  | ||||||
|     "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=="], | ||||||
|  |  | ||||||
|   | |||||||
| @@ -32,7 +32,7 @@ | |||||||
|     "react-hook-form": "^7.60.0", |     "react-hook-form": "^7.60.0", | ||||||
|     "react-i18next": "^15.6.0", |     "react-i18next": "^15.6.0", | ||||||
|     "react-markdown": "^10.1.0", |     "react-markdown": "^10.1.0", | ||||||
|     "react-router": "^7.6.3", |     "react-router": "^7.7.0", | ||||||
|     "sonner": "^2.0.6", |     "sonner": "^2.0.6", | ||||||
|     "tailwind-merge": "^3.3.1", |     "tailwind-merge": "^3.3.1", | ||||||
|     "tailwindcss": "^4.1.11", |     "tailwindcss": "^4.1.11", | ||||||
| @@ -53,6 +53,6 @@ | |||||||
|     "tw-animate-css": "^1.3.5", |     "tw-animate-css": "^1.3.5", | ||||||
|     "typescript": "~5.8.3", |     "typescript": "~5.8.3", | ||||||
|     "typescript-eslint": "^8.37.0", |     "typescript-eslint": "^8.37.0", | ||||||
|     "vite": "^7.0.4" |     "vite": "^7.0.5" | ||||||
|   } |   } | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "حدث خطأ", |     "errorTitle": "حدث خطأ", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Kunne ikke indlæse godkendelsesudbydere. Tjek venligst din konfiguration.", |     "failedToFetchProvidersTitle": "Kunne ikke indlæse godkendelsesudbydere. Tjek venligst din konfiguration.", | ||||||
|     "errorTitle": "Der opstod en fejl", |     "errorTitle": "Der opstod en fejl", | ||||||
|     "errorSubtitle": "Der opstod en fejl under forsøget på at udføre denne handling. Tjek venligst konsollen for mere information.", |     "errorSubtitle": "Der opstod en fejl under forsøget på at udføre denne handling. Tjek venligst konsollen for mere information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Fehler beim Laden der Authentifizierungsanbieter. Bitte überprüfen Sie Ihre Konfiguration.", |     "failedToFetchProvidersTitle": "Fehler beim Laden der Authentifizierungsanbieter. Bitte überprüfen Sie Ihre Konfiguration.", | ||||||
|     "errorTitle": "Ein Fehler ist aufgetreten", |     "errorTitle": "Ein Fehler ist aufgetreten", | ||||||
|     "errorSubtitle": "Beim Versuch, diese Aktion auszuführen, ist ein Fehler aufgetreten. Bitte überprüfen Sie die Konsole für weitere Informationen.", |     "errorSubtitle": "Beim Versuch, diese Aktion auszuführen, ist ein Fehler aufgetreten. Bitte überprüfen Sie die Konsole für weitere Informationen.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Αποτυχία φόρτωσης παρόχων πιστοποίησης. Παρακαλώ ελέγξτε τις ρυθμίσεις σας.", |     "failedToFetchProvidersTitle": "Αποτυχία φόρτωσης παρόχων πιστοποίησης. Παρακαλώ ελέγξτε τις ρυθμίσεις σας.", | ||||||
|     "errorTitle": "Παρουσιάστηκε ένα σφάλμα", |     "errorTitle": "Παρουσιάστηκε ένα σφάλμα", | ||||||
|     "errorSubtitle": "Παρουσιάστηκε σφάλμα κατά την προσπάθεια εκτέλεσης αυτής της ενέργειας. Ελέγξτε την κονσόλα για περισσότερες πληροφορίες.", |     "errorSubtitle": "Παρουσιάστηκε σφάλμα κατά την προσπάθεια εκτέλεσης αυτής της ενέργειας. Ελέγξτε την κονσόλα για περισσότερες πληροφορίες.", | ||||||
|     "forgotPasswordMessage": "Μπορείτε να επαναφέρετε τον κωδικό πρόσβασής σας αλλάζοντας τη μεταβλητή περιβάλλοντος `USERS`." |     "forgotPasswordMessage": "Μπορείτε να επαναφέρετε τον κωδικό πρόσβασής σας αλλάζοντας τη μεταβλητή περιβάλλοντος `USERS`.", | ||||||
|  |     "fieldRequired": "Αυτό το πεδίο είναι υποχρεωτικό", | ||||||
|  |     "invalidInput": "Μη έγκυρη καταχώρηση" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Error al cargar los proveedores de autenticación. Por favor revise su configuración.", |     "failedToFetchProvidersTitle": "Error al cargar los proveedores de autenticación. Por favor revise su configuración.", | ||||||
|     "errorTitle": "Ha ocurrido un error", |     "errorTitle": "Ha ocurrido un error", | ||||||
|     "errorSubtitle": "Ocurrió un error mientras se trataba de realizar esta acción. Por favor, revise la consola para más información.", |     "errorSubtitle": "Ocurrió un error mientras se trataba de realizar esta acción. Por favor, revise la consola para más información.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Échec du chargement des fournisseurs d'authentification. Veuillez vérifier votre configuration.", |     "failedToFetchProvidersTitle": "Échec du chargement des fournisseurs d'authentification. Veuillez vérifier votre configuration.", | ||||||
|     "errorTitle": "Une erreur est survenue", |     "errorTitle": "Une erreur est survenue", | ||||||
|     "errorSubtitle": "Une erreur est survenue lors de l'exécution de cette action. Veuillez consulter la console pour plus d'informations.", |     "errorSubtitle": "Une erreur est survenue lors de l'exécution de cette action. Veuillez consulter la console pour plus d'informations.", | ||||||
|     "forgotPasswordMessage": "Vous pouvez réinitialiser votre mot de passe en modifiant la variable d'environnement `USERS`." |     "forgotPasswordMessage": "Vous pouvez réinitialiser votre mot de passe en modifiant la variable d'environnement `USERS`.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Nie udało się załadować dostawców uwierzytelniania. Sprawdź swoją konfigurację.", |     "failedToFetchProvidersTitle": "Nie udało się załadować dostawców uwierzytelniania. Sprawdź swoją konfigurację.", | ||||||
|     "errorTitle": "Wystąpił błąd", |     "errorTitle": "Wystąpił błąd", | ||||||
|     "errorSubtitle": "Wystąpił błąd podczas próby wykonania tej czynności. Sprawdź konsolę, aby uzyskać więcej informacji.", |     "errorSubtitle": "Wystąpił błąd podczas próby wykonania tej czynności. Sprawdź konsolę, aby uzyskać więcej informacji.", | ||||||
|     "forgotPasswordMessage": "Możesz zresetować hasło, zmieniając zmienną środowiskową `USERS`." |     "forgotPasswordMessage": "Możesz zresetować hasło, zmieniając zmienną środowiskową `USERS`.", | ||||||
|  |     "fieldRequired": "To pole jest wymagane", | ||||||
|  |     "invalidInput": "Nieprawidłowe dane wejściowe" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Не удалось загрузить провайдеров аутентификации. Пожалуйста, проверьте конфигурацию.", |     "failedToFetchProvidersTitle": "Не удалось загрузить провайдеров аутентификации. Пожалуйста, проверьте конфигурацию.", | ||||||
|     "errorTitle": "Произошла ошибка", |     "errorTitle": "Произошла ошибка", | ||||||
|     "errorSubtitle": "Произошла ошибка при попытке выполнить это действие. Проверьте консоль для дополнительной информации.", |     "errorSubtitle": "Произошла ошибка при попытке выполнить это действие. Проверьте консоль для дополнительной информации.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -1,55 +1,57 @@ | |||||||
| { | { | ||||||
|     "loginTitle": "Welcome back, login with", |     "loginTitle": "Добродошли назад, пријавите се са", | ||||||
|     "loginTitleSimple": "Welcome back, please login", |     "loginTitleSimple": "Добродошли назад, молим вас пријавите се", | ||||||
|     "loginDivider": "Or", |     "loginDivider": "Или", | ||||||
|     "loginUsername": "Username", |     "loginUsername": "Корисничко име", | ||||||
|     "loginPassword": "Password", |     "loginPassword": "Лозинка", | ||||||
|     "loginSubmit": "Login", |     "loginSubmit": "Пријава", | ||||||
|     "loginFailTitle": "Failed to log in", |     "loginFailTitle": "Неуспешна пријава", | ||||||
|     "loginFailSubtitle": "Please check your username and password", |     "loginFailSubtitle": "Молим вас проверите ваше корисничко име и лозинку", | ||||||
|     "loginFailRateLimit": "You failed to login too many times. Please try again later", |     "loginFailRateLimit": "Нисте успели да се пријавите превише пута. Молим вас покушајте касније", | ||||||
|     "loginSuccessTitle": "Logged in", |     "loginSuccessTitle": "Пријављени", | ||||||
|     "loginSuccessSubtitle": "Welcome back!", |     "loginSuccessSubtitle": "Добродошли назад!", | ||||||
|     "loginOauthFailTitle": "An error occurred", |     "loginOauthFailTitle": "Појавила се грешка", | ||||||
|     "loginOauthFailSubtitle": "Failed to get OAuth URL", |     "loginOauthFailSubtitle": "Неуспело преузимање OAuth адресе", | ||||||
|     "loginOauthSuccessTitle": "Redirecting", |     "loginOauthSuccessTitle": "Преусмеравање", | ||||||
|     "loginOauthSuccessSubtitle": "Redirecting to your OAuth provider", |     "loginOauthSuccessSubtitle": "Преусмеравање на вашег OAuth провајдера", | ||||||
|     "continueRedirectingTitle": "Redirecting...", |     "continueRedirectingTitle": "Преусмеравање...", | ||||||
|     "continueRedirectingSubtitle": "You should be redirected to the app soon", |     "continueRedirectingSubtitle": "Требали би сте ускоро да будете преусмерени на апликацију", | ||||||
|     "continueInvalidRedirectTitle": "Invalid redirect", |     "continueInvalidRedirectTitle": "Неисправно преусмеравање", | ||||||
|     "continueInvalidRedirectSubtitle": "The redirect URL is invalid", |     "continueInvalidRedirectSubtitle": "Адреса за преусмеравање није исправна", | ||||||
|     "continueInsecureRedirectTitle": "Insecure redirect", |     "continueInsecureRedirectTitle": "Небезбедно преусмеравање", | ||||||
|     "continueInsecureRedirectSubtitle": "You are trying to redirect from <code>https</code> to <code>http</code> which is not secure. Are you sure you want to continue?", |     "continueInsecureRedirectSubtitle": "Покушавате да преусмерите са <code>https</code> на <code>http</code> што није безбедно. Да ли желите да наставите?", | ||||||
|     "continueTitle": "Continue", |     "continueTitle": "Настави", | ||||||
|     "continueSubtitle": "Click the button to continue to your app.", |     "continueSubtitle": "Кликните на дугме да би сте наставили на нашу апликацију.", | ||||||
|     "logoutFailTitle": "Failed to log out", |     "logoutFailTitle": "Неуспешно одјављивање", | ||||||
|     "logoutFailSubtitle": "Please try again", |     "logoutFailSubtitle": "Молим вас покушајте поново", | ||||||
|     "logoutSuccessTitle": "Logged out", |     "logoutSuccessTitle": "Одјављени", | ||||||
|     "logoutSuccessSubtitle": "You have been logged out", |     "logoutSuccessSubtitle": "Одјављени сте", | ||||||
|     "logoutTitle": "Logout", |     "logoutTitle": "Одјава", | ||||||
|     "logoutUsernameSubtitle": "You are currently logged in as <code>{{username}}</code>. Click the button below to logout.", |     "logoutUsernameSubtitle": "Тренутно сте пријављени као <code>{{username}}</code>. Кликните на дугме испод да се одјавите.", | ||||||
|     "logoutOauthSubtitle": "You are currently logged in as <code>{{username}}</code> using the {{provider}} OAuth provider. Click the button below to logout.", |     "logoutOauthSubtitle": "Тренутно сте пријављени као <code>{{username}}</code> користећи {{provider}} OAuth провајдера. Кликните на дугме испод да се одјавите.", | ||||||
|     "notFoundTitle": "Page not found", |     "notFoundTitle": "Страница није пронађена", | ||||||
|     "notFoundSubtitle": "The page you are looking for does not exist.", |     "notFoundSubtitle": "Страница коју тражите не постоји.", | ||||||
|     "notFoundButton": "Go home", |     "notFoundButton": "На почетак", | ||||||
|     "totpFailTitle": "Failed to verify code", |     "totpFailTitle": "Неуспело потврђивање кода", | ||||||
|     "totpFailSubtitle": "Please check your code and try again", |     "totpFailSubtitle": "Молим вас проверите ваш код и покушајте поново", | ||||||
|     "totpSuccessTitle": "Verified", |     "totpSuccessTitle": "Потврђен", | ||||||
|     "totpSuccessSubtitle": "Redirecting to your app", |     "totpSuccessSubtitle": "Преусмеравање на вашу апликацију", | ||||||
|     "totpTitle": "Enter your TOTP code", |     "totpTitle": "Унесите ваш TOTP код", | ||||||
|     "totpSubtitle": "Please enter the code from your authenticator app.", |     "totpSubtitle": "Молим вас унесите код из ваше апликације за аутентификацију.", | ||||||
|     "unauthorizedTitle": "Unauthorized", |     "unauthorizedTitle": "Неауторизован", | ||||||
|     "unauthorizedResourceSubtitle": "The user with username <code>{{username}}</code> is not authorized to access the resource <code>{{resource}}</code>.", |     "unauthorizedResourceSubtitle": "Корисник са корисничким именом <code>{{username}}</code> није ауторизован да приступи ресурсу <code>{{resource}}</code>.", | ||||||
|     "unauthorizedLoginSubtitle": "The user with username <code>{{username}}</code> is not authorized to login.", |     "unauthorizedLoginSubtitle": "Корисник са корисничким именом <code>{{username}}</code> није ауторизован за пријављивање.", | ||||||
|     "unauthorizedGroupsSubtitle": "The user with username <code>{{username}}</code> is not in the groups required by the resource <code>{{resource}}</code>.", |     "unauthorizedGroupsSubtitle": "Корисник са корисничким именом <code>{{username}}</code> није у групама које захтева ресурс <code>{{resource}}</code>.", | ||||||
|     "unauthorizedIpSubtitle": "Your IP address <code>{{ip}}</code> is not authorized to access the resource <code>{{resource}}</code>.", |     "unauthorizedIpSubtitle": "Ваша IP адреса <code>{{ip}}</code> није ауторизована да приступи ресурсу <code>{{resource}}</code>.", | ||||||
|     "unauthorizedButton": "Try again", |     "unauthorizedButton": "Покушајте поново", | ||||||
|     "untrustedRedirectTitle": "Untrusted redirect", |     "untrustedRedirectTitle": "Преусмерење без поверења", | ||||||
|     "untrustedRedirectSubtitle": "You are trying to redirect to a domain that does not match your configured domain (<code>{{domain}}</code>). Are you sure you want to continue?", |     "untrustedRedirectSubtitle": "Покушавате да преусмерите на домен који се не поклапа са подешеним доменом (<code>{{domain}}</code>). Да ли желите да наставите?", | ||||||
|     "cancelTitle": "Cancel", |     "cancelTitle": "Поништи", | ||||||
|     "forgotPasswordTitle": "Forgot your password?", |     "forgotPasswordTitle": "Заборавили сте лозинку?", | ||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Није успело учитавање провајдера аутентификације. Молим вас проверите ваша подешавања.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "Појавила се грешка", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "Појавила се грешка при покушају извршавања ове радње. Молим вас проверите конзолу за додатне информације.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "Можете поништити вашу лозинку променом `USERS` променљиве окружења.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", |     "failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.", | ||||||
|     "errorTitle": "An error occurred", |     "errorTitle": "An error occurred", | ||||||
|     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", |     "errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "加载身份验证提供程序失败,请检查您的配置。", |     "failedToFetchProvidersTitle": "加载身份验证提供程序失败,请检查您的配置。", | ||||||
|     "errorTitle": "发生了错误", |     "errorTitle": "发生了错误", | ||||||
|     "errorSubtitle": "执行此操作时发生错误,请检查控制台以获取更多信息。", |     "errorSubtitle": "执行此操作时发生错误,请检查控制台以获取更多信息。", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -14,7 +14,7 @@ | |||||||
|     "loginOauthFailSubtitle": "無法取得 OAuth 網址", |     "loginOauthFailSubtitle": "無法取得 OAuth 網址", | ||||||
|     "loginOauthSuccessTitle": "重新導向中", |     "loginOauthSuccessTitle": "重新導向中", | ||||||
|     "loginOauthSuccessSubtitle": "正在將您重新導向至 OAuth 供應商", |     "loginOauthSuccessSubtitle": "正在將您重新導向至 OAuth 供應商", | ||||||
|     "continueRedirectingTitle": "重新導向中...", |     "continueRedirectingTitle": "重新導向中……", | ||||||
|     "continueRedirectingSubtitle": "您即將被重新導向至應用程式", |     "continueRedirectingSubtitle": "您即將被重新導向至應用程式", | ||||||
|     "continueInvalidRedirectTitle": "無效的重新導向", |     "continueInvalidRedirectTitle": "無效的重新導向", | ||||||
|     "continueInvalidRedirectSubtitle": "重新導向的網址無效", |     "continueInvalidRedirectSubtitle": "重新導向的網址無效", | ||||||
| @@ -51,5 +51,7 @@ | |||||||
|     "failedToFetchProvidersTitle": "載入驗證供應商失敗。請檢查您的設定。", |     "failedToFetchProvidersTitle": "載入驗證供應商失敗。請檢查您的設定。", | ||||||
|     "errorTitle": "發生錯誤", |     "errorTitle": "發生錯誤", | ||||||
|     "errorSubtitle": "執行此操作時發生錯誤。請檢查主控台以獲取更多資訊。", |     "errorSubtitle": "執行此操作時發生錯誤。請檢查主控台以獲取更多資訊。", | ||||||
|     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable." |     "forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.", | ||||||
|  |     "fieldRequired": "This field is required", | ||||||
|  |     "invalidInput": "Invalid input" | ||||||
| } | } | ||||||
| @@ -138,7 +138,7 @@ func (h *Handlers) OAuthCallbackHandler(c *gin.Context) { | |||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	log.Debug().Msg("Got user") | 	log.Debug().Interface("user", user).Msg("Got user") | ||||||
|  |  | ||||||
| 	// Check that email is not empty | 	// Check that email is not empty | ||||||
| 	if user.Email == "" { | 	if user.Email == "" { | ||||||
|   | |||||||
| @@ -130,11 +130,11 @@ func (l *LDAP) reconnect() error { | |||||||
|  |  | ||||||
| 	operation := func() (*ldapgo.Conn, error) { | 	operation := func() (*ldapgo.Conn, error) { | ||||||
| 		l.Conn.Close() | 		l.Conn.Close() | ||||||
| 		_, err := l.connect() | 		conn, err := l.connect() | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			return nil, nil | 			return nil, nil | ||||||
| 		} | 		} | ||||||
| 		return nil, nil | 		return conn, nil | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	_, err := backoff.Retry(context.TODO(), operation, backoff.WithBackOff(exp), backoff.WithMaxTries(3)) | 	_, err := backoff.Retry(context.TODO(), operation, backoff.WithBackOff(exp), backoff.WithMaxTries(3)) | ||||||
|   | |||||||
| @@ -32,6 +32,6 @@ func GetGenericUser(client *http.Client, url string) (constants.Claims, error) { | |||||||
| 		return user, err | 		return user, err | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	log.Debug().Interface("user", user).Msg("Parsed user from generic provider") | 	log.Debug().Msg("Parsed user from generic provider") | ||||||
| 	return user, nil | 	return user, nil | ||||||
| } | } | ||||||
|   | |||||||
| @@ -21,6 +21,23 @@ type Server struct { | |||||||
| 	Router   *gin.Engine | 	Router   *gin.Engine | ||||||
| } | } | ||||||
|  |  | ||||||
|  | var ( | ||||||
|  | 	loggerSkipPathsPrefix = []string{ | ||||||
|  | 		"GET /api/healthcheck", | ||||||
|  | 		"HEAD /api/healthcheck", | ||||||
|  | 		"GET /favicon.ico", | ||||||
|  | 	} | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | func logPath(path string) bool { | ||||||
|  | 	for _, prefix := range loggerSkipPathsPrefix { | ||||||
|  | 		if strings.HasPrefix(path, prefix) { | ||||||
|  | 			return false | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 	return true | ||||||
|  | } | ||||||
|  |  | ||||||
| func NewServer(config types.ServerConfig, handlers *handlers.Handlers) (*Server, error) { | func NewServer(config types.ServerConfig, handlers *handlers.Handlers) (*Server, error) { | ||||||
| 	gin.SetMode(gin.ReleaseMode) | 	gin.SetMode(gin.ReleaseMode) | ||||||
|  |  | ||||||
| @@ -68,6 +85,7 @@ func NewServer(config types.ServerConfig, handlers *handlers.Handlers) (*Server, | |||||||
|  |  | ||||||
| 	// App routes | 	// App routes | ||||||
| 	router.GET("/api/healthcheck", handlers.HealthcheckHandler) | 	router.GET("/api/healthcheck", handlers.HealthcheckHandler) | ||||||
|  | 	router.HEAD("/api/healthcheck", handlers.HealthcheckHandler) | ||||||
|  |  | ||||||
| 	return &Server{ | 	return &Server{ | ||||||
| 		Config:   config, | 		Config:   config, | ||||||
| @@ -84,29 +102,29 @@ func (s *Server) Start() error { | |||||||
| // zerolog is a middleware for gin that logs requests using zerolog | // zerolog is a middleware for gin that logs requests using zerolog | ||||||
| func zerolog() gin.HandlerFunc { | func zerolog() gin.HandlerFunc { | ||||||
| 	return func(c *gin.Context) { | 	return func(c *gin.Context) { | ||||||
| 		// Get initial time |  | ||||||
| 		tStart := time.Now() | 		tStart := time.Now() | ||||||
|  |  | ||||||
| 		// Process request |  | ||||||
| 		c.Next() | 		c.Next() | ||||||
|  |  | ||||||
| 		// Get status code, address, method and path |  | ||||||
| 		code := c.Writer.Status() | 		code := c.Writer.Status() | ||||||
| 		address := c.Request.RemoteAddr | 		address := c.Request.RemoteAddr | ||||||
| 		method := c.Request.Method | 		method := c.Request.Method | ||||||
| 		path := c.Request.URL.Path | 		path := c.Request.URL.Path | ||||||
|  |  | ||||||
| 		// Get latency |  | ||||||
| 		latency := time.Since(tStart).String() | 		latency := time.Since(tStart).String() | ||||||
|  |  | ||||||
| 		// Log request | 		// logPath check if the path should be logged normally or with debug | ||||||
| 		switch { | 		if logPath(method + " " + path) { | ||||||
| 		case code >= 200 && code < 300: | 			switch { | ||||||
| 			log.Info().Str("method", method).Str("path", path).Str("address", address).Int("status", code).Str("latency", latency).Msg("Request") | 			case code >= 200 && code < 300: | ||||||
| 		case code >= 300 && code < 400: | 				log.Info().Str("method", method).Str("path", path).Str("address", address).Int("status", code).Str("latency", latency).Msg("Request") | ||||||
| 			log.Warn().Str("method", method).Str("path", path).Str("address", address).Int("status", code).Str("latency", latency).Msg("Request") | 			case code >= 300 && code < 400: | ||||||
| 		case code >= 400: | 				log.Warn().Str("method", method).Str("path", path).Str("address", address).Int("status", code).Str("latency", latency).Msg("Request") | ||||||
| 			log.Error().Str("method", method).Str("path", path).Str("address", address).Int("status", code).Str("latency", latency).Msg("Request") | 			case code >= 400: | ||||||
|  | 				log.Error().Str("method", method).Str("path", path).Str("address", address).Int("status", code).Str("latency", latency).Msg("Request") | ||||||
|  | 			} | ||||||
|  | 		} else { | ||||||
|  | 			log.Debug().Str("method", method).Str("path", path).Str("address", address).Int("status", code).Str("latency", latency).Msg("Request") | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
| @@ -330,12 +330,21 @@ func DeriveKey(secret string, info string) (string, error) { | |||||||
|  |  | ||||||
| func CoalesceToString(value any) string { | func CoalesceToString(value any) string { | ||||||
| 	switch v := value.(type) { | 	switch v := value.(type) { | ||||||
| 	case []string: | 	case []any: | ||||||
| 		return strings.Join(v, ",") | 		log.Debug().Msg("Coalescing []any to string") | ||||||
|  | 		strs := make([]string, 0, len(v)) | ||||||
|  | 		for _, item := range v { | ||||||
|  | 			if str, ok := item.(string); ok { | ||||||
|  | 				strs = append(strs, str) | ||||||
|  | 				continue | ||||||
|  | 			} | ||||||
|  | 			log.Warn().Interface("item", item).Msg("Item in []any is not a string, skipping") | ||||||
|  | 		} | ||||||
|  | 		return strings.Join(strs, ",") | ||||||
| 	case string: | 	case string: | ||||||
| 		return v | 		return v | ||||||
| 	default: | 	default: | ||||||
| 		log.Warn().Interface("value", value).Msg("Unsupported type, returning empty string") | 		log.Warn().Interface("value", value).Interface("type", v).Msg("Unsupported type, returning empty string") | ||||||
| 		return "" | 		return "" | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
| @@ -515,7 +515,7 @@ func TestDeriveKey(t *testing.T) { | |||||||
| func TestCoalesceToString(t *testing.T) { | func TestCoalesceToString(t *testing.T) { | ||||||
| 	t.Log("Testing coalesce to string with a string") | 	t.Log("Testing coalesce to string with a string") | ||||||
|  |  | ||||||
| 	value := "test" | 	value := any("test") | ||||||
| 	expected := "test" | 	expected := "test" | ||||||
|  |  | ||||||
| 	result := utils.CoalesceToString(value) | 	result := utils.CoalesceToString(value) | ||||||
| @@ -526,10 +526,10 @@ func TestCoalesceToString(t *testing.T) { | |||||||
|  |  | ||||||
| 	t.Log("Testing coalesce to string with a slice of strings") | 	t.Log("Testing coalesce to string with a slice of strings") | ||||||
|  |  | ||||||
| 	valueSlice := []string{"test1", "test2"} | 	value = []any{any("test1"), any("test2"), any(123)} | ||||||
| 	expected = "test1,test2" | 	expected = "test1,test2" | ||||||
|  |  | ||||||
| 	result = utils.CoalesceToString(valueSlice) | 	result = utils.CoalesceToString(value) | ||||||
|  |  | ||||||
| 	if result != expected { | 	if result != expected { | ||||||
| 		t.Fatalf("Expected %v, got %v", expected, result) | 		t.Fatalf("Expected %v, got %v", expected, result) | ||||||
| @@ -537,10 +537,10 @@ func TestCoalesceToString(t *testing.T) { | |||||||
|  |  | ||||||
| 	t.Log("Testing coalesce to string with an unsupported type") | 	t.Log("Testing coalesce to string with an unsupported type") | ||||||
|  |  | ||||||
| 	valueUnsupported := 12345 | 	value = 12345 | ||||||
| 	expected = "" | 	expected = "" | ||||||
|  |  | ||||||
| 	result = utils.CoalesceToString(valueUnsupported) | 	result = utils.CoalesceToString(value) | ||||||
|  |  | ||||||
| 	if result != expected { | 	if result != expected { | ||||||
| 		t.Fatalf("Expected %v, got %v", expected, result) | 		t.Fatalf("Expected %v, got %v", expected, result) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user