From d5c53aaf19dce5a300a23c3bc8f89819da9ead11 Mon Sep 17 00:00:00 2001 From: Zao Soula Date: Thu, 12 Dec 2024 19:39:11 +0100 Subject: [PATCH] feat: add infomaniak oauth --- app/Providers/EventServiceProvider.php | 2 + bootstrap/helpers/socialite.php | 1 + composer.json | 1 + composer.lock | 53 ++++++++++++++++++++++++- database/seeders/OauthSettingSeeder.php | 1 + lang/ar.json | 1 + lang/cs.json | 1 + lang/de.json | 1 + lang/en.json | 1 + lang/es.json | 3 +- lang/fa.json | 1 + lang/fr.json | 1 + lang/it.json | 1 + lang/ja.json | 1 + lang/pt.json | 1 + lang/ro.json | 1 + lang/tr.json | 1 + lang/vi.json | 1 + lang/zh-cn.json | 1 + lang/zh-tw.json | 1 + 20 files changed, 73 insertions(+), 2 deletions(-) diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index aa3579f8da..428f78cb5a 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -11,6 +11,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use SocialiteProviders\Authentik\AuthentikExtendSocialite; use SocialiteProviders\Azure\AzureExtendSocialite; +use SocialiteProviders\Infomaniak\InfomaniakExtendSocialite; use SocialiteProviders\Manager\SocialiteWasCalled; class EventServiceProvider extends ServiceProvider @@ -25,6 +26,7 @@ class EventServiceProvider extends ServiceProvider SocialiteWasCalled::class => [ AzureExtendSocialite::class.'@handle', AuthentikExtendSocialite::class.'@handle', + InfomaniakExtendSocialite::class.'@handle', ], ProxyStarted::class => [ ProxyStartedNotification::class, diff --git a/bootstrap/helpers/socialite.php b/bootstrap/helpers/socialite.php index 130227e815..09dffb78ab 100644 --- a/bootstrap/helpers/socialite.php +++ b/bootstrap/helpers/socialite.php @@ -40,6 +40,7 @@ function get_socialite_provider(string $provider) 'github' => \Laravel\Socialite\Two\GithubProvider::class, 'gitlab' => \Laravel\Socialite\Two\GitlabProvider::class, 'google' => \Laravel\Socialite\Two\GoogleProvider::class, + 'infomaniak' => \SocialiteProviders\Infomaniak\Provider::class, ]; return Socialite::buildProvider( diff --git a/composer.json b/composer.json index b8dc354c32..8e8ad0a4b2 100644 --- a/composer.json +++ b/composer.json @@ -40,6 +40,7 @@ "resend/resend-laravel": "^0.15.0", "sentry/sentry-laravel": "^4.6", "socialiteproviders/authentik": "^5.2", + "socialiteproviders/infomaniak": "^4.0", "socialiteproviders/microsoft-azure": "^5.1", "spatie/laravel-activitylog": "^4.7.3", "spatie/laravel-data": "^4.11", diff --git a/composer.lock b/composer.lock index 3fbe72afb4..50d64cba26 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "871067cb42e6347ca53ff36e81ac5079", + "content-hash": "5517a7becb5d31fa2ef3ecfaea06f7a7", "packages": [ { "name": "3sidedcube/laravel-redoc", @@ -7467,6 +7467,57 @@ }, "time": "2023-11-07T22:21:16+00:00" }, + { + "name": "socialiteproviders/infomaniak", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/SocialiteProviders/Infomaniak.git", + "reference": "9796ad686204443bfdf3ff19a6c409e8771667e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/SocialiteProviders/Infomaniak/zipball/9796ad686204443bfdf3ff19a6c409e8771667e1", + "reference": "9796ad686204443bfdf3ff19a6c409e8771667e1", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^8.0", + "socialiteproviders/manager": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "SocialiteProviders\\Infomaniak\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Leopold Jacquot", + "email": "leopold.jacquot@infomaniak.com" + } + ], + "description": "Infomaniak OAuth2 Provider for Laravel Socialite", + "keywords": [ + "infomaniak", + "laravel", + "oauth", + "oauth2", + "provider", + "socialite" + ], + "support": { + "docs": "https://socialiteproviders.com/qq", + "issues": "https://github.com/socialiteproviders/providers/issues", + "source": "https://github.com/socialiteproviders/providers" + }, + "time": "2024-11-20T05:42:36+00:00" + }, { "name": "socialiteproviders/manager", "version": "v4.7.0", diff --git a/database/seeders/OauthSettingSeeder.php b/database/seeders/OauthSettingSeeder.php index e004d14508..d93e6ec9ce 100644 --- a/database/seeders/OauthSettingSeeder.php +++ b/database/seeders/OauthSettingSeeder.php @@ -19,6 +19,7 @@ public function run(): void 'gitlab', 'google', 'authentik', + 'infomaniak', ]); $isOauthSeeded = OauthSetting::count() > 0; diff --git a/lang/ar.json b/lang/ar.json index 4b9afbe996..b473318d3a 100644 --- a/lang/ar.json +++ b/lang/ar.json @@ -5,6 +5,7 @@ "auth.login.github": "تسجيل الدخول باستخدام GitHub", "auth.login.gitlab": "تسجيل الدخول باستخدام Gitlab", "auth.login.google": "تسجيل الدخول باستخدام Google", + "auth.login.infomaniak": "تسجيل الدخول باستخدام Infomaniak", "auth.already_registered": "هل سبق لك التسجيل؟", "auth.confirm_password": "تأكيد كلمة المرور", "auth.forgot_password": "نسيت كلمة المرور", diff --git a/lang/cs.json b/lang/cs.json index 48b47b06a3..270fd272ba 100644 --- a/lang/cs.json +++ b/lang/cs.json @@ -5,6 +5,7 @@ "auth.login.github": "Přihlásit se pomocí GitHubu", "auth.login.gitlab": "Přihlásit se pomocí Gitlabu", "auth.login.google": "Přihlásit se pomocí Google", + "auth.login.infomaniak": "Přihlásit se pomocí Infomaniak", "auth.already_registered": "Již jste registrováni?", "auth.confirm_password": "Potvrďte heslo", "auth.forgot_password": "Zapomněli jste heslo", diff --git a/lang/de.json b/lang/de.json index 29fec629f2..c5644e3a7a 100644 --- a/lang/de.json +++ b/lang/de.json @@ -5,6 +5,7 @@ "auth.login.github": "Mit GitHub anmelden", "auth.login.gitlab": "Mit GitLab anmelden", "auth.login.google": "Mit Google anmelden", + "auth.login.infomaniak": "Mit Infomaniak anmelden", "auth.already_registered": "Bereits registriert?", "auth.confirm_password": "Passwort bestätigen", "auth.forgot_password": "Passwort vergessen", diff --git a/lang/en.json b/lang/en.json index 4e0749ece8..cdca686013 100644 --- a/lang/en.json +++ b/lang/en.json @@ -6,6 +6,7 @@ "auth.login.github": "Login with GitHub", "auth.login.gitlab": "Login with Gitlab", "auth.login.google": "Login with Google", + "auth.login.infomaniak": "Login with Infomaniak", "auth.already_registered": "Already registered?", "auth.confirm_password": "Confirm password", "auth.forgot_password": "Forgot password", diff --git a/lang/es.json b/lang/es.json index 0d8c0c9406..aceacd4625 100644 --- a/lang/es.json +++ b/lang/es.json @@ -5,6 +5,7 @@ "auth.login.github": "Acceder con GitHub", "auth.login.gitlab": "Acceder con Gitlab", "auth.login.google": "Acceder con Google", + "auth.login.infomaniak": "Acceder con Infomaniak", "auth.already_registered": "¿Ya estás registrado?", "auth.confirm_password": "Confirmar contraseña", "auth.forgot_password": "¿Olvidaste tu contraseña?", @@ -27,4 +28,4 @@ "input.recovery_code": "Código de recuperación", "button.save": "Guardar", "repository.url": "Examples
Para repositorios públicos, usar https://....
Para repositorios privados, usar git@....

https://github.com/coollabsio/coolify-examples main la rama 'main' será seleccionada.
https://github.com/coollabsio/coolify-examples/tree/nodejs-fastify nodejs-fastify la rama 'nodejs-fastify' será seleccionada.
https://gitea.com/sedlav/expressjs.git main la rama 'main' será seleccionada.
https://gitlab.com/andrasbacsai/nodejs-example.git main la rama 'main' será seleccionada." -} \ No newline at end of file +} diff --git a/lang/fa.json b/lang/fa.json index d0ecc4a3b8..7a714e6266 100644 --- a/lang/fa.json +++ b/lang/fa.json @@ -5,6 +5,7 @@ "auth.login.github": "ورود با گیت هاب", "auth.login.gitlab": "ورود با گیت لب", "auth.login.google": "ورود با گوگل", + "auth.login.infomaniak": "ورود با Infomaniak", "auth.already_registered": "قبلاً ثبت نام کرده‌اید؟", "auth.confirm_password": "تایید رمز عبور", "auth.forgot_password": "فراموشی رمز عبور", diff --git a/lang/fr.json b/lang/fr.json index dbd5a1bf7a..a94d633d39 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -5,6 +5,7 @@ "auth.login.github": "Connexion avec GitHub", "auth.login.gitlab": "Connexion avec Gitlab", "auth.login.google": "Connexion avec Google", + "auth.login.infomaniak": "Connexion avec Infomaniak", "auth.already_registered": "Déjà enregistré ?", "auth.confirm_password": "Confirmer le mot de passe", "auth.forgot_password": "Mot de passe oublié", diff --git a/lang/it.json b/lang/it.json index 6e4feb9ccb..30b9f39026 100644 --- a/lang/it.json +++ b/lang/it.json @@ -5,6 +5,7 @@ "auth.login.github": "Accedi con GitHub", "auth.login.gitlab": "Accedi con Gitlab", "auth.login.google": "Accedi con Google", + "auth.login.infomaniak": "Accedi con Infomaniak", "auth.already_registered": "Già registrato?", "auth.confirm_password": "Conferma password", "auth.forgot_password": "Password dimenticata", diff --git a/lang/ja.json b/lang/ja.json index 4652a3b178..4d45899001 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -5,6 +5,7 @@ "auth.login.github": "GitHubでログイン", "auth.login.gitlab": "Gitlabでログイン", "auth.login.google": "Googleでログイン", + "auth.login.infomaniak": "Infomaniakでログイン", "auth.already_registered": "すでに登録済みですか?", "auth.confirm_password": "パスワードを確認", "auth.forgot_password": "パスワードを忘れた", diff --git a/lang/pt.json b/lang/pt.json index b5dd5c434e..c5f393e65c 100644 --- a/lang/pt.json +++ b/lang/pt.json @@ -5,6 +5,7 @@ "auth.login.github": "Entrar com GitHub", "auth.login.gitlab": "Entrar com Gitlab", "auth.login.google": "Entrar com Google", + "auth.login.infomaniak": "Entrar com Infomaniak", "auth.already_registered": "Já tem uma conta?", "auth.confirm_password": "Confirmar senha", "auth.forgot_password": "Esqueceu a senha?", diff --git a/lang/ro.json b/lang/ro.json index db1aa85db5..4c7968cfa2 100644 --- a/lang/ro.json +++ b/lang/ro.json @@ -5,6 +5,7 @@ "auth.login.github": "Autentificare prin GitHub", "auth.login.gitlab": "Autentificare prin Gitlab", "auth.login.google": "Autentificare prin Google", + "auth.login.infomaniak": "Autentificare prin Infomaniak", "auth.already_registered": "Sunteți deja înregistrat?", "auth.confirm_password": "Confirmați parola", "auth.forgot_password": "Ați uitat parola", diff --git a/lang/tr.json b/lang/tr.json index 255b0d15be..3cbcee4098 100644 --- a/lang/tr.json +++ b/lang/tr.json @@ -5,6 +5,7 @@ "auth.login.github": "GitHub ile Giriş Yap", "auth.login.gitlab": "GitLab ile Giriş Yap", "auth.login.google": "Google ile Giriş Yap", + "auth.login.infomaniak": "Infomaniak ile Giriş Yap", "auth.already_registered": "Zaten kayıtlı mısınız?", "auth.confirm_password": "Şifreyi Onayla", "auth.forgot_password": "Şifremi Unuttum", diff --git a/lang/vi.json b/lang/vi.json index 548dbe8b72..bb43fd34d4 100644 --- a/lang/vi.json +++ b/lang/vi.json @@ -5,6 +5,7 @@ "auth.login.github": "Đăng Nhập Bằng GitHub", "auth.login.gitlab": "Đăng Nhập Bằng Gitlab", "auth.login.google": "Đăng Nhập Bằng Google", + "auth.login.infomaniak": "Đăng Nhập Bằng Infomaniak", "auth.already_registered": "Đã đăng ký?", "auth.confirm_password": "Nhập lại mật khẩu", "auth.forgot_password": "Quên mật khẩu", diff --git a/lang/zh-cn.json b/lang/zh-cn.json index 70c457fa8b..944887a5fc 100644 --- a/lang/zh-cn.json +++ b/lang/zh-cn.json @@ -5,6 +5,7 @@ "auth.login.github": "使用 GitHub 登录", "auth.login.gitlab": "使用 Gitlab 登录", "auth.login.google": "使用 Google 登录", + "auth.login.infomaniak": "使用 Infomaniak 登录", "auth.already_registered": "已经注册?", "auth.confirm_password": "确认密码", "auth.forgot_password": "忘记密码", diff --git a/lang/zh-tw.json b/lang/zh-tw.json index 63956f7a13..c42ebb33e3 100644 --- a/lang/zh-tw.json +++ b/lang/zh-tw.json @@ -5,6 +5,7 @@ "auth.login.github": "使用 GitHub 登入", "auth.login.gitlab": "使用 Gitlab 登入", "auth.login.google": "使用 Google 登入", + "auth.login.infomaniak": "使用 Infomaniak 登入", "auth.already_registered": "已經註冊?", "auth.confirm_password": "確認密碼", "auth.forgot_password": "忘記密碼",