Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
netvs-middleware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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 GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scc-net
netvs
netvs-middleware
Commits
70bb4fa4
Commit
70bb4fa4
authored
3 weeks ago
by
Alexander Kaschta
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Perform requests as logged in user
parent
9df11918
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#419738
passed
3 weeks ago
Stage: lint
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/bcd_request.py
+5
-4
5 additions, 4 deletions
api/bcd_request.py
with
5 additions
and
4 deletions
api/bcd_request.py
+
5
−
4
View file @
70bb4fa4
...
...
@@ -16,7 +16,7 @@ js_mods = ['bcdrequest']
@router.post
(
''
)
async
def
handle_request
(
bcd_request
:
BCDRequestModel
,
token
:
APIToken
=
Depends
(
check_auth
),
conn
=
Depends
(
get_conn
)):
Mgr
.
check_token
(
conn
,
token
)
user
=
Mgr
.
check_token
(
conn
,
token
)
ou_request
=
execute_wapi_function
(
conn
,
[
{
"
idx
"
:
"
own_mgr2ou_list
"
,
"
name
"
:
"
cntl.mgr2ou.list
"
,
"
old
"
:
{
"
is_own
"
:
True
}},
...
...
@@ -29,7 +29,8 @@ async def handle_request(bcd_request: BCDRequestModel, token: APIToken = Depends
{
"
name
"
:
"
dns.fqdn2ou.list
"
,
"
inner_join_ref
"
:
{
"
unit_list_superset
"
:
"
default
"
},
"
idx
"
:
"
fqdn2ou_list
"
},
{
"
name
"
:
"
nd.bcd2ou.list
"
,
"
inner_join_ref
"
:
{
"
unit_list_superset
"
:
"
default
"
},
"
idx
"
:
"
bcd2ou_list
"
},
{
"
name
"
:
"
nd.bcd.list
"
,
"
inner_join_ref
"
:
{
"
bcd2ou_list
"
:
"
default
"
},
"
idx
"
:
"
bcd_list
"
},
{
"
name
"
:
"
org.unit_type.list
"
,
"
inner_join_ref
"
:
{
"
unit_list
"
:
"
default
"
},
"
idx
"
:
"
unit_type_list
"
}])
{
"
name
"
:
"
org.unit_type.list
"
,
"
inner_join_ref
"
:
{
"
unit_list
"
:
"
default
"
},
"
idx
"
:
"
unit_type_list
"
}],
user
=
user
.
login_name
)
ous
=
[
item
[
"
short_name
"
]
for
item
in
ou_request
[
"
unit_list
"
]]
...
...
@@ -59,7 +60,8 @@ async def handle_request(bcd_request: BCDRequestModel, token: APIToken = Depends
{
"
idx
"
:
"
recursive_mgr2ou_list
"
,
"
name
"
:
"
cntl.mgr2ou.list
"
,
"
inner_join_ref
"
:
{
"
parent_ous
"
:
"
default
"
}},
{
"
idx
"
:
"
recursive_mgr_list
"
,
"
name
"
:
"
cntl.mgr.list
"
,
"
inner_join_ref
"
:
{
"
recursive_mgr2ou_list
"
:
"
default
"
}},
{
"
idx
"
:
"
recursive_bcd_list
"
,
"
name
"
:
"
nd.bcd.list
"
,
"
inner_join_ref
"
:
{
"
recursive_bcd2ou_list
"
:
"
default
"
}},
{
"
name
"
:
"
org.unit_type.list
"
,
"
inner_join_ref
"
:
{
"
current_ou
"
:
"
default
"
},
"
idx
"
:
"
unit_type_list
"
}])
{
"
name
"
:
"
org.unit_type.list
"
,
"
inner_join_ref
"
:
{
"
current_ou
"
:
"
default
"
},
"
idx
"
:
"
unit_type_list
"
}],
user
=
user
.
login_name
)
groups
=
[
item
[
"
name
"
]
for
item
in
group_request
[
"
group_list
"
]]
...
...
@@ -77,7 +79,6 @@ async def handle_request(bcd_request: BCDRequestModel, token: APIToken = Depends
def
validate_bcd_request
(
bcd_request
:
BCDRequestModel
)
->
bool
:
if
(
bcd_request
.
protection_requirement
==
BCDProtectionRequirements
.
SPECIAL
and
bcd_request
.
protection_requirement_note
is
None
):
raise
HTTPException
(
...
...
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