Skip to content

Commit

Permalink
Merge pull request #34 from nebari-dev/sharing-app-toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech authored Jan 5, 2024
2 parents 3a70e8c + f198795 commit 0024588
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions jhub_apps/service/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class UserOptions(BaseModel):
custom_command: typing.Optional[str] = str()
conda_env: typing.Optional[str] = str()
profile: typing.Optional[str] = str()
# Make app available to public (unauthenticated Hub users)
public: typing.Optional[bool] = False


class ServerCreation(BaseModel):
Expand Down
5 changes: 4 additions & 1 deletion jhub_apps/spawner/spawner_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,12 @@ async def start(self):
self.user_options.get("jhub_app")
and framework != Framework.jupyterlab.value
):
auth_type = "oauth"
if self.user_options.get("public", False):
auth_type = "none"
self.cmd = DEFAULT_CMD.get_substituted_args(
python_exec=self.config.JAppsConfig.python_exec,
authtype=self.config.JAppsConfig.apps_auth_type,
authtype=auth_type,
)
if framework == Framework.jupyterlab.value:
self.cmd = [
Expand Down
1 change: 1 addition & 0 deletions jhub_apps/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def mock_user_options():
"custom_command": "",
"conda_env": "",
"profile": "",
"public": False
}
return user_options

Expand Down

0 comments on commit 0024588

Please sign in to comment.