Skip to content

Commit

Permalink
Update change logs and login instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Sep 28, 2024
1 parent e9111a1 commit b4458a5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Hypha Change Log

### 0.20.38
- Allow passing workspace and expires_in to the `login` function to generate workspace specific token.
- When using http endpoint to access the service, you can now pass workspace specific token to the http header `Authorization` to access the service. (Previously, all the services are assumed to be accessed from the same service provider workspace)

### 0.20.37
- Add s3-proxy to allow accessing s3 presigned url in case the s3 server is not directly accessible. Use `--enable-s3-proxy` to enable the s3 proxy when starting Hypha.
- Add `artifact-manager` service to provide comprehensive artifact management, used for creating gallery-like service portal. The artifact manager service is backed by s3 storage and supports presigned url for direct access to the artifacts. This is a replacement of the previous `card` service.

### 0.20.36

- Upgrade hypha-rpc to support updating reconnection token (otherwise it generate token expired error after some time)
Expand Down
24 changes: 22 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ By default all the clients connected to Hypha server communicate via the websock

### User Login and Token-Based Authentication

To access the full features of the Hypha server, users need to log in and obtain a token for authentication. The new `login()` function provides a convenient way to display a login URL, once the user click it and login, it can then return the token for connecting to the server.
To access the full features of the Hypha server, users need to log in and obtain a token for authentication. The `login()` function provides a convenient way to display a login URL, once the user click it and login, it can then return the token for connecting to the server.

Here is an example of how the login process works using the `login()` function:

Expand Down Expand Up @@ -294,7 +294,27 @@ The output will provide a URL for the user to open in their browser and

perform the login process. Once the user clicks the link and successfully logs in, the `login()` function will return, providing the token.

The `login()` function also supports additional arguments:
#### Additional Arguments for Login

You can specify the `workspace` and `expires_in` arguments in the `login()` function so that the token is generated for a specific workspace and expires after a certain period of time.

```python
token = await login(
{
"server_url": SERVER_URL,
"workspace": "my-workspace",
"expires_in": 3600,
}
)
```

If a token is generated for a specific workspace, when calling `connect_to_server`, you need to specify the same workspace as well:

```python
server = await connect_to_server({"server_url": "https://ai.imjoy.io", "token": token, "workspace": "my-workspace"})
```

The `login()` function also supports other additional arguments:

```python
token = await login(
Expand Down

0 comments on commit b4458a5

Please sign in to comment.