-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #509 from wri/feature/user_role
Pass user details when authenticating instead of a bool, check for manager on dataset creation
- Loading branch information
Showing
10 changed files
with
103 additions
and
65 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
from sqlalchemy import create_engine | ||
from sqlalchemy.orm import Session, sessionmaker | ||
|
||
from app.models.pydantic.authentication import User | ||
from app.settings.globals import ( | ||
AWS_REGION, | ||
DATA_LAKE_BUCKET, | ||
|
@@ -51,8 +52,6 @@ | |
BUCKET = "test-bucket" | ||
PORT = 9000 | ||
|
||
RW_USER_ID = "5874bfcca049b7a56ad42771" # pragma: allowlist secret | ||
|
||
SessionLocal: Optional[Session] = None | ||
|
||
|
||
|
@@ -315,8 +314,16 @@ async def get_api_key_mocked() -> Tuple[Optional[str], Optional[str]]: | |
return str(uuid.uuid4()), "localhost" | ||
|
||
|
||
async def get_rw_user_id() -> str: | ||
return RW_USER_ID | ||
async def get_manager_mocked() -> User: | ||
return User( | ||
id="mr_manager123", | ||
name="Mr. Manager", | ||
email="[email protected]", | ||
createdAt="2021-06-13T03:18:23.000Z", | ||
role="MANAGER", | ||
applications=[], | ||
extraUserData={}, | ||
) | ||
|
||
|
||
def setup_clients(ec2_client, iam_client): | ||
|
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
Oops, something went wrong.