-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔏 Requires valid access tokens for API calls #173
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e1d3329
Requires valid access tokens for API calls
afred 2dab4f9
Adds comments, tests, fixes edge cases
mrharpo c905f4a
Actually checks for permissions on Sony Ci sync api endpoint.
afred 6069d03
Adds permissions dependency
mrharpo 04e6c8c
Allows (str, list, set) as permissions
mrharpo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Postgres URL for Chowda DB. | ||
# Format: postgresql://{user}:{password}@{host}:{port}/{database} | ||
DB_URL='' | ||
|
||
# Env vars beginning with "AUTH0_" are used for authentication and authorization with Auth0. | ||
# These values can be obtained by logging into our Auth0 account. | ||
AUTH0_DOMAIN='' | ||
AUTH0_CLIENT_ID='' | ||
AUTH0_CLIENT_SECRET='' | ||
AUTH0_API_AUDIENCE='' | ||
|
||
# Secret value for securing session data using SessionMiddleware | ||
CHOWDA_SECRET='' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,9 @@ ci.toml | |
|
||
# Metaflow generated files | ||
metaflow.s3.* | ||
.metaflow | ||
.metaflow | ||
|
||
.cache_ggshield | ||
|
||
.env.* | ||
!.env.sample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
from datetime import datetime | ||
from typing import Annotated | ||
|
||
from fastapi import APIRouter, HTTPException | ||
from fastapi import APIRouter, HTTPException, Depends | ||
from metaflow.integrations import ArgoEvent | ||
from pydantic import BaseModel | ||
from chowda.auth.utils import verified_access_token, OAuthAccessToken | ||
|
||
sony_ci = APIRouter() | ||
|
||
|
@@ -12,7 +14,9 @@ class SyncResponse(BaseModel): | |
|
||
|
||
@sony_ci.post('/sync', tags=['sync']) | ||
async def sony_ci_sync() -> SyncResponse: | ||
async def sony_ci_sync( | ||
token: Annotated[OAuthAccessToken, Depends(verified_access_token)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to check for |
||
) -> SyncResponse: | ||
try: | ||
ArgoEvent('sync').publish(ignore_errors=False) | ||
return SyncResponse(started_at=datetime.utcnow()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these supposed to be the same thing?