Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
76a4008d
Commit
76a4008d
authored
11 months ago
by
Mohammad Torkashvand
Browse files
Options
Downloads
Patches
Plain Diff
add todo for inventory-provider and client-credential flow
parent
ba98cc43
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!215
Feature/nat 468 refactor auth
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gso/__init__.py
+5
-0
5 additions, 0 deletions
gso/__init__.py
gso/api/v1/processes.py
+2
-3
2 additions, 3 deletions
gso/api/v1/processes.py
gso/auth/opa.py
+2
-5
2 additions, 5 deletions
gso/auth/opa.py
with
9 additions
and
8 deletions
gso/__init__.py
+
5
−
0
View file @
76a4008d
...
...
@@ -9,6 +9,9 @@ from orchestrator.graphql import SCALAR_OVERRIDES
import
gso.products
import
gso.workflows
# noqa: F401
from
gso.api
import
router
as
api_router
from
gso.auth.oidc
import
oidc_instance
from
gso.auth.opa
import
opa_instance
from
gso.middlewares
import
ModifyProcessEndpointResponse
from
gso.graphql_api.types
import
GSO_SCALAR_OVERRIDES
SCALAR_OVERRIDES
.
update
(
GSO_SCALAR_OVERRIDES
)
...
...
@@ -17,6 +20,8 @@ SCALAR_OVERRIDES.update(GSO_SCALAR_OVERRIDES)
def
init_gso_app
()
->
OrchestratorCore
:
"""
Initialise the :term:`GSO` app.
"""
app
=
OrchestratorCore
(
base_settings
=
app_settings
)
app
.
register_authentication
(
oidc_instance
)
app
.
register_authorization
(
opa_instance
)
app
.
register_graphql
()
app
.
include_router
(
api_router
,
prefix
=
"
/api
"
)
return
app
...
...
This diff is collapsed.
Click to expand it.
gso/api/v1/processes.py
+
2
−
3
View file @
76a4008d
...
...
@@ -6,11 +6,10 @@ from uuid import UUID
from
fastapi
import
APIRouter
,
Depends
,
HTTPException
,
status
from
orchestrator.db
import
ProcessStepTable
from
orchestrator.schemas.base
import
OrchestratorBaseModel
from
orchestrator.security
import
get_
authoriz
ation
from
orchestrator.security
import
authoriz
e
authorization
=
get_authorization
()
router
=
APIRouter
(
prefix
=
"
/processes
"
,
tags
=
[
"
Processes
"
],
dependencies
=
[
Depends
(
authorization
.
authorize
)])
router
=
APIRouter
(
prefix
=
"
/processes
"
,
tags
=
[
"
Processes
"
],
dependencies
=
[
Depends
(
authorize
)])
class
CallBackResultsBaseModel
(
OrchestratorBaseModel
):
...
...
This diff is collapsed.
Click to expand it.
gso/auth/opa.py
+
2
−
5
View file @
76a4008d
...
...
@@ -21,11 +21,6 @@ class OPAAuthorization(OPAAuthorization):
cls
.
_instance
=
super
(
OPAAuthorization
,
cls
).
__new__
(
cls
)
return
cls
.
_instance
async
def
authorize
(
self
,
request
:
Request
,
user_info
:
OIDCUserModel
=
Depends
(
oidc_instance
.
authenticate
)
)
->
bool
|
None
:
return
await
super
().
authorize
(
request
,
user_info
)
async
def
get_decision
(
self
,
async_request
:
AsyncClient
,
opa_input
:
dict
)
->
OPAResult
:
logger
.
debug
(
"
Posting input json to Policy agent
"
,
opa_url
=
self
.
opa_url
,
input
=
opa_input
)
try
:
...
...
@@ -42,3 +37,5 @@ class OPAAuthorization(OPAAuthorization):
opa_instance
=
OPAAuthorization
(
opa_url
=
oauth2lib_settings
.
OPA_URL
,
)
# TODO - Think about Inventoryo-provider since it is not defined in the code but is used in the old branch
\ No newline at end of file
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