Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
134245e3
Commit
134245e3
authored
9 years ago
by
Kevin S. Hahn
Browse files
Options
Downloads
Patches
Plain Diff
treats authd drone request as non-public superuser
parent
2abea8b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
base.py
+7
-3
7 additions, 3 deletions
base.py
with
7 additions
and
3 deletions
base.py
+
7
−
3
View file @
134245e3
...
...
@@ -53,12 +53,16 @@ class RequestHandler(webapp2.RequestHandler):
if
not
self
.
app
.
db
.
sites
.
find_one
({
'
_id
'
:
remote_instance
}):
self
.
abort
(
402
,
remote_instance
+
'
is not an authorized remote instance
'
)
else
:
if
not
self
.
app
.
db
.
drones
.
find_one
({
'
_id
'
:
remote_instance
}):
self
.
abort
(
402
,
remote_instance
+
'
is not an authorized drone
'
)
drone_type
,
drone_id
=
self
.
request
.
user_agent
.
replace
(
'
SciTran
'
,
''
).
strip
().
split
()
if
not
self
.
app
.
db
.
drones
.
find_one
({
'
_id
'
:
drone_id
}):
self
.
abort
(
402
,
drone_id
+
'
is not an authorized drone
'
)
self
.
drone_request
=
True
self
.
public_request
=
not
bool
(
self
.
uid
)
log
.
debug
(
'
public request: %s
'
%
str
(
self
.
public_request
))
if
self
.
public_request
or
self
.
source_site
:
if
self
.
drone_request
and
not
self
.
source_site
:
# engine request
self
.
public_request
=
False
self
.
superuser_request
=
True
elif
self
.
public_request
or
self
.
source_site
:
self
.
superuser_request
=
False
else
:
user
=
self
.
app
.
db
.
users
.
find_one
({
'
_id
'
:
self
.
uid
},
[
'
root
'
,
'
wheel
'
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment