Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
29922d18
Commit
29922d18
authored
May 11, 2021
by
Gosia Ksionek
Committed by
Markus Koller
May 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve enforce SSO-Only Authentication is blocking PAT use for APIs
Changelog: fixed
parent
a19e7b79
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
ee/changelogs/unreleased/pat_error.yml
ee/changelogs/unreleased/pat_error.yml
+5
-0
ee/lib/gitlab/auth/group_saml/session_enforcer.rb
ee/lib/gitlab/auth/group_saml/session_enforcer.rb
+1
-0
ee/spec/lib/gitlab/auth/group_saml/session_enforcer_spec.rb
ee/spec/lib/gitlab/auth/group_saml/session_enforcer_spec.rb
+6
-0
No files found.
ee/changelogs/unreleased/pat_error.yml
0 → 100644
View file @
29922d18
---
title
:
Fix error caused by enforcing SSO-Only Authentication for Git Activity for PAT tokens
merge_request
:
61348
author
:
type
:
fixed
ee/lib/gitlab/auth/group_saml/session_enforcer.rb
View file @
29922d18
...
@@ -51,6 +51,7 @@ module Gitlab
...
@@ -51,6 +51,7 @@ module Gitlab
end
end
def
user_allowed?
def
user_allowed?
return
true
if
user
.
bot?
return
true
if
user
.
auditor?
||
user
.
can_read_all_resources?
return
true
if
user
.
auditor?
||
user
.
can_read_all_resources?
return
true
if
group
.
owned_by?
(
user
)
return
true
if
group
.
owned_by?
(
user
)
...
...
ee/spec/lib/gitlab/auth/group_saml/session_enforcer_spec.rb
View file @
29922d18
...
@@ -150,6 +150,12 @@ RSpec.describe Gitlab::Auth::GroupSaml::SessionEnforcer do
...
@@ -150,6 +150,12 @@ RSpec.describe Gitlab::Auth::GroupSaml::SessionEnforcer do
it
{
is_expected
.
to
be_falsey
}
it
{
is_expected
.
to
be_falsey
}
end
end
context
'with project bot'
do
let
(
:user
)
{
create
(
:user
,
:project_bot
)
}
it
{
is_expected
.
to
be_falsey
}
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment