github descope/go-sdk v0.9.4

latest releases: v1.6.7, v1.6.6, v1.6.5...
21 months ago

Breaking changes

  • 🚨 Session and Refresh token split 🚨: Session validation and refresh tokens have been split in order to allow more control over session management.
    3 new functions have been added, 2 variations each (a total of 6), with a more predictable and straightforward behavior:
* `ValidateSessionWithRequest` - only validates the session - searches for session token in the request.
* `ValidateSessionWithToken` - only validates the session - receives token as input.
* `RefreshSessionWithRequest` - refreshes a session - searches for session token in the request.
* `RefreshSessionWithToken` - refreshes a session - receives token as input.
* `ValidateAndRefreshSessionWithRequest` - combines the two, validate and refresh as needed - searches for tokens in the request.
* `ValidateAndRefreshSessionWithTokens` - combines the two, validate and refresh as needed - receives tokens as input.

These function replace the following which have been removed:

* `ValidateSession` - replaced by `ValidateAndRefreshSessionWithRequest` with the change of requiring both tokens.
* `ValidateSessionTokens` - replaced by `ValidateAndRefreshSessionWithTokens` with the change of requiring both tokens.
* `RefreshSession` - replaced by `RefreshSessionWithRequest` and `RefreshSessionWithToken`, behavior remains with more consistent naming and input validation.
  • 👀 Reorganization of packages 👀 : We introduces a new package for our Descope client:
    • Instead of generating the Descope client with descope.NewDescopeClient, you should now use client.New.
    • The rest of the public symbols are now under the descope package.
  • User function update: Along with adding support for user attribute update actions (such as UpdateDisplayName), we also changed a few things in the existing response:
    • Create and Update user commands will now return the user object in the response, on top of user errors.
    • Status attribute is now also included in the UserResponse object (not breaking).

Enhancements

  • Documentation enhancements: Multiple enhancements to our SDK documentation, including the README and some management related examples.
  • Error handling: In order to make our errors as clear and convenient as possible for the Descoper, we redesigned the way they are created, experienced (on various levels) and handled. This change includes:
    • A new descope.Error object - for a unified error object from both client and server errors.
  • Rate limiting: In order to maintain our stable performance, and provide a good experience to all of our customers, we added SDK and API rate limits. You can read more in our documentation.
  • Cookie domain configuration: Cookie domain can now be set via the client config; this configuration will take precedence over the domain configured in the Descope console.
  • Support single token in validate and refresh commands: Both sessionToken and refreshToken functions support a single token behavior:
    • If only the sessionToken is provided - default to a 'validate only' behavior (validateSession)
    • If only the refreshToken is provided - default to a 'refresh only' behavior (refreshSession)

Don't miss a new go-sdk release

NewReleases is sending notifications on new releases.