Skip to content

Commit

Permalink
add auth state and log auth state
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed Jan 7, 2024
1 parent a7b4827 commit cb16822
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions jhub_apps/service/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class User(BaseModel):
last_activity: Optional[datetime] = None
servers: Optional[Dict[str, Server]] = None
scopes: List[str]
auth_state: Optional[Dict] = None


# https://stackoverflow.com/questions/64501193/fastapi-how-to-use-httpexception-in-responses
Expand Down
6 changes: 3 additions & 3 deletions jhub_apps/service/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,15 @@ async def get_frameworks(user: User = Depends(get_current_user)):

@router.get("/conda-environments/", description="Get all conda environments")
async def conda_environments(user: User = Depends(get_current_user)):
logging.info("Getting conda environments")
logging.info(f"Getting conda environments for user: {user}")
config = get_jupyterhub_config()
conda_envs = get_conda_envs(config)
return conda_envs


@router.get("/spawner-profiles/", description="Get all spawner profiles")
async def spawner_profiles(user: User = Depends(get_current_user)):
logging.info("Getting spawner profiles")
logging.info(f"Getting spawner profiles for user: {user}")
config = get_jupyterhub_config()
spawner_profiles_ = await get_spawner_profiles(config)
logger.info(f"Loaded spawner profiles: {config}")
Expand All @@ -244,7 +244,7 @@ async def spawner_profiles(user: User = Depends(get_current_user)):

@router.get("/services/", description="Get all services")
async def hub_services(user: User = Depends(get_current_user)):
logging.info("Getting hub services")
logging.info(f"Getting hub services for user: {user}")
hub_client = HubClient()
return hub_client.get_services()

Expand Down

0 comments on commit cb16822

Please sign in to comment.