Releases: AgoraIO-Community/agora-token-service
v1.5
What's Changed
- Bump golang.org/x/crypto from 0.14.0 to 0.17.0 by @dependabot in #51
- Bump google.golang.org/protobuf from 1.30.0 to 1.33.0 by @dependabot in #53
- Bump golang.org/x/net from 0.17.0 to 0.23.0 by @dependabot in #55
- Makefile by @digitallysavvy in #56
- added preflight support by @digitallysavvy in #58
Full Changelog: v1.4.4...v1.5
v1.4.4
Re-added ping/pong health check.
v1.4.3
What's Changed
- Update render.yaml by @EkaanshArora in #42
- Public methods by @maxxfrazer in #43
Full Changelog: v1.4.2...v1.4.3
v1.4.3-rc.2
Make more functions available through imports
v1.4.2
Added CORS control, this helps determine which origins are permitted to access the resources of your application.
v1.4.1
Changes Made
- Added a new function "getToken" to the Service struct to handle the "getToken" endpoint (POST requests).
- Implemented logic to parse the request body into a TokenRequest struct to process token generation requests.
- Implemented functions to generate RTC tokens, RTM tokens, and chat tokens based on the TokenRequest.
- updated to go-tokenbuilder 1.3.0, which gives streamtokens with rtm if channel name is provided.
New Endpoint Details
Endpoint: /getToken
HTTP Method: POST
Request Payload:
{
"tokenType": "rtc", // The token type: "rtc", "rtm", or "chat"
"channel": "channel123", // The channel name (used for RTC and RTM tokens)
"role": "publisher", // The role of the user for RTC tokens (publisher or subscriber)
"uid": "123", // The user ID or account (used for RTC, RTM, and some chat tokens)
"expire": 3600 // The token expiration time in seconds (used for all token types)
}
Response
Upon successful generation of the token, the API will respond with an HTTP status code of 200 OK
, and the response body will contain the token in a JSON key "token"
.
{
"token": "007hbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhZG1pbiIsInN1YiI6InVzZXIxMjMiLCJpYXQiOjE2MzEwNTU4NzIsImV4cCI6MTYzMTA1OTQ3Mn0.3eJ-RGwIl2ANFbdv4SeHtWzGiv6PpC3i0UqXlHfsqEw"
}
If there are validation errors in the request or issues during token generation, the endpoint responds with an appropriate error message and the corresponding status code.
Full Changelog: v1.4.0...v1.4.1
v1.4.0
To use chat tokens:
endpoint structure
- app privileges:
chat/app/?expiry=3600
- user privileges:
/chat/account/:chatid/?expiry=3600
expiry
is an optional parameter for both.
response:
{
"chatToken":"007chat-token-djfkaljdla"
}
v1.3.0
Tokens now compatible with Signaling (RTM 2)
Tokens are backwards compatible.
1.2.1
Fix issue with RTC tokens when RTM ID is not passed.
1.2.0
- Separate
/service
file structure. This means a different way to execute. - Dockerfile updated to work with Railway.app
- Badges updated
- Fix having different RTC and RTM tokens