mirror of
https://github.com/coollabsio/coolify.git
synced 2026-08-24 10:05:47 -05:00
Add OIDC discovery, JWKS validation, Socialite integration, OAuth identity linking, and configurable registration policy for password and SSO signups. Update related settings/profile UI and tests.
31 lines
875 B
PHP
31 lines
875 B
PHP
<?php
|
|
|
|
use App\Models\OauthSetting;
|
|
use Tests\TestCase;
|
|
|
|
uses(TestCase::class);
|
|
|
|
it('requires issuer url client id and client secret for oidc settings', function () {
|
|
$setting = new OauthSetting(['provider' => 'oidc']);
|
|
expect($setting->couldBeEnabled())->toBeFalse();
|
|
|
|
$setting->fill([
|
|
'client_id' => 'client-id',
|
|
'client_secret' => 'secret',
|
|
'base_url' => 'https://idp.example.com',
|
|
]);
|
|
|
|
expect($setting->couldBeEnabled())->toBeTrue();
|
|
});
|
|
|
|
it('returns configured scopes and custom login label', function () {
|
|
$setting = new OauthSetting([
|
|
'provider' => 'oidc',
|
|
'scopes' => 'openid email profile groups',
|
|
'custom_label' => 'Login with Okta',
|
|
]);
|
|
|
|
expect($setting->scopeList())->toBe(['openid', 'email', 'profile', 'groups'])
|
|
->and($setting->loginLabel())->toBe('Login with Okta');
|
|
});
|