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
aa681393
Commit
aa681393
authored
1 year ago
by
Mohammad Torkashvand
Committed by
Neda Moeini
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
change key and value in THIRD_PARTY_API_KEYS dict
parent
4939e5d2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!149
Add API key authentication for routes
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gso/auth/api_key_auth.py
+1
-1
1 addition, 1 deletion
gso/auth/api_key_auth.py
gso/oss-params-example.json
+2
-2
2 additions, 2 deletions
gso/oss-params-example.json
test/conftest.py
+2
-2
2 additions, 2 deletions
test/conftest.py
with
5 additions
and
5 deletions
gso/auth/api_key_auth.py
+
1
−
1
View file @
aa681393
...
...
@@ -14,7 +14,7 @@ async def get_api_key(api_key: str = Depends(api_key_header)) -> str:
settings
=
load_oss_params
()
# TODO: This is a simulated database of API keys which should be replace with a real one
if
api_key
in
settings
.
THIRD_PARTY_API_KEYS
:
if
api_key
in
settings
.
THIRD_PARTY_API_KEYS
.
values
()
:
return
api_key
raise
HTTPException
(
status_code
=
status
.
HTTP_403_FORBIDDEN
,
detail
=
"
Invalid API Key
"
)
This diff is collapsed.
Click to expand it.
gso/oss-params-example.json
+
2
−
2
View file @
aa681393
...
...
@@ -75,7 +75,7 @@
"result_expires"
:
3600
},
"THIRD_PARTY_API_KEYS"
:
{
"REALLY_random_AND_secure_T0keN"
:
"Ansible Dynamic Inventory Generator"
,
"Another_REAL
L
Y_random_AND_
se
cure_T0keN"
:
"Application 2"
"Ansible Dynamic Inventory Generator"
:
"REALLY_random_AND_secure_T0keN"
,
"A
pplication 2"
:
"a
nother_REALY_random_AND_
3
cure_T0keN"
}
}
This diff is collapsed.
Click to expand it.
test/conftest.py
+
2
−
2
View file @
aa681393
...
...
@@ -205,8 +205,8 @@ def configuration_data() -> dict:
"
result_expires
"
:
3600
,
},
"
THIRD_PARTY_API_KEYS
"
:
{
"
REALY_random_AND_3cure_T0keN
"
:
"
LSO
"
,
"
another_REALY_random_AND_3cure_T0keN
"
:
"
Application 2
"
,
"
Ansible Dynamic Inventory Generator
"
:
"
REALY_random_AND_3cure_T0keN
"
,
"
Application 2
"
:
"
another_REALY_random_AND_3cure_T0keN
"
,
},
}
...
...
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