Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
299
Merge Requests
43
CI / CD
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
ef3d7433
Commit
ef3d7433
authored
just now
by
Emiliano Balbuena
Browse files
Options
Download
(chore): Allow SSO from root domains
parent
c2c95dfd
goal/pro-sso
1 merge request
!400
WIP: SSO for Pro sites
Pipeline
#96256498
running with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
Core/Pro/Domain.php
View file @
ef3d7433
...
...
@@ -71,6 +71,16 @@ class Domain
return
!
$settings
||
((
string
)
$settings
->
getUserGuid
()
===
$userGuid
);
}
/**
* @param string $domain
* @return bool
*/
public
function
isRoot
(
string
$domain
)
:
bool
{
$rootDomains
=
$this
->
config
->
get
(
'pro'
)[
'root_domains'
]
??
[];
return
in_array
(
strtolower
(
$domain
),
$rootDomains
,
true
);
}
/**
* @param Settings $settings
* @param User|null $owner
...
...
This diff is collapsed.
Core/SSO/Delegates/ProDelegate.php
View file @
ef3d7433
...
...
@@ -26,6 +26,7 @@ class ProDelegate
public
function
isAllowed
(
$domain
)
{
return
(
bool
)
$this
->
proDomain
->
lookup
(
$domain
);
return
$this
->
proDomain
->
isRoot
(
$domain
)
||
(
bool
)
$this
->
proDomain
->
lookup
(
$domain
);
}
}
This diff is collapsed.
Spec/Core/Pro/DomainSpec.php
View file @
ef3d7433
...
...
@@ -173,6 +173,23 @@ class DomainSpec extends ObjectBehavior
->
shouldReturn
(
false
);
}
public
function
it_should_check_if_root_domain
()
{
$this
->
config
->
get
(
'pro'
)
->
shouldBeCalled
()
->
willReturn
([
'root_domains'
=>
[
'phpspec.test'
]
]);
$this
->
isRoot
(
'phpspec.test'
)
->
shouldReturn
(
true
);
$this
->
isRoot
(
'not-a-root-phpspec.test'
)
->
shouldReturn
(
false
);
}
public
function
it_should_get_icon
(
Settings
$settings
,
User
$owner
...
...
This diff is collapsed.
Please
register
or
sign in
to comment