Skip to content

Releases: authsignal/authsignal-php

4.0.0

08 Dec 22:00
68c9dce
Compare
Choose a tag to compare

Release Notes

Changes have been made so that conventions used in the PHP SDK align with Authsignal's general SDK conventions.

Breaking Changes

  1. track Method

    • Old Signature:
      public static function track(string $userId, string $action, array $payload)
    • New Signature:
      public static function track(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user you are tracking the action for.
      • action (string): The action code that you are tracking.
      • attributes (array): An array of attributes to track.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
      • The payload parameter has been replaced with attributes in the implementation.
  2. getAction Method

    • Old Signature:
      public static function getAction(string $userId, string $action, string $idempotencyKey)
    • New Signature:
      public static function getAction(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user you are tracking the action for.
      • action (string): The action code that you are tracking.
      • idempotencyKey (string): The idempotency key for the action.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
  3. getUser Method

    • Old Signature:
      public static function getUser(string $userId, string $redirectUrl = null)
    • New Signature:
      public static function getUser(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user you are tracking the action for.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
      • Removed redirectUrl from the params.
  4. updateUser Method

    • Old Signature:
      public static function updateUser(string $userId, array $data)
    • New Signature:
      public static function updateUser(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user to update.
      • attributes (array): The attributes to update for the user.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
  5. enrollVerifiedAuthenticator Method

    • Old Signature:
      public static function enrollVerifiedAuthenticator(string $userId, array $authenticator)
    • New Signature:
      public static function enrollVerifiedAuthenticator(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user you are tracking the action for.
      • attributes (array): The authenticator object to enroll.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
  6. deleteUser Method

    • Old Signature:
      public static function deleteUser(string $userId)
    • New Signature:
      public static function deleteUser(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user you want to delete.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
  7. deleteAuthenticator Method

    • Old Signature:
      public static function deleteAuthenticator(string $userId, string $userAuthenticatorId)
    • New Signature:
      public static function deleteAuthenticator(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user.
      • userAuthenticatorId (string): The userAuthenticatorId of the authenticator to delete.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
  8. validateChallenge Method

    • Old Signature:
      public static function validateChallenge(string $token, string $userId = null, string $action = null)
    • New Signature:
      public static function validateChallenge(array $params)
    • Parameters in Associative Array:
      • token (string): The JWT token string returned on a challenge response.
      • userId (string|null): The userId of the user you are tracking the action for (optional).
      • action (string|null): The action code that you are tracking (optional).
    • Changes:
      • The method now accepts a single associative array parameter named $params.
  9. RenamesetApiKey Method to setApiSecretKey

  10. RenamegetApiKey Method to getApiSecretKey

  11. Rename setApiHostname to setApiUrl

  12. Rename AUTHSIGNAL_SERVER_API_ENDPOINT env var to AUTHSIGNAL_API_URL

  13. Remove setApiVersion and getApiVersion

  • The version should be set when the URL is set with setApiUrl or the AUTHSIGNAL_API_URL env variable.

Non Breaking Changes

  1. Add updateAction Method

    • Signature:
      public static function updateAction(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user to update the action for.
      • action (string): The action code to update.
      • idempotencyKey (string): The idempotency key for the action.
      • attributes (array): Additional attributes for the action.
  2. ** getAuthenticators Method**

  • Signature:
    public static function getAuthenticators(array $params)
  • Description: Retrieves the list of authenticators for a specified user.
  • Parameters in Associative Array:
    • userId (string): The userId of the user whose authenticators you want to retrieve.
  • Returns: An array containing the list of user authenticators.
  • Throws:
    • AuthsignalApiException if the request fails.

Example Usage:

$params = [
    'userId' => '12345' // The userId of the user whose authenticators you want to retrieve
];

$authenticators = Authsignal::getAuthenticators($params);
 

3.0.1

30 Oct 00:34
877abd6
Compare
Choose a tag to compare

Bug fix

  • Fix issue where 300 -> 399 range API responses were causing an error to be thrown.

3.0.0

29 Oct 04:04
484e02c
Compare
Choose a tag to compare

Breaking Changes:

  • Rename deleteUserAuthenticator to deleteAuthenticator for consistency.
  • Omit deprecated actionCode from validateChallenge response.

Other changes:

  • Omit keys with null values from API requests by default.
  • Add action option in validateChallenge method: Ensures that the validated action matches the tracked action when the action parameter is provided.

2.0.2

09 Oct 03:35
3fd2549
Compare
Choose a tag to compare

2.0.2 Release Notes

New Features

deleteUser

  • Description: This method allows for the deletion of a user from Authsignal.
  • Parameters:
    • $userId (string): The unique identifier of the user to be deleted.
  • Returns: array('success' => true)

deleteUserAuthenticator

  • Description: This method securely deletes a user's authenticator.
  • Parameters:
    • $userId (string): The unique identifier of the user.
  • Returns: array('success' => true)

updateUser

  • Description: Updates the details of an existing user.
  • Parameters:
    • $userId (string): The user's unique identifier.
    • $data (array): Updated user details.
  • Returns: The updated user as an associative array.

2.0.0

02 May 02:07
7241f32
Compare
Choose a tag to compare

This change simplifies the validateChallenge function by calling Authsignal's API to validate a challenge.

Breaking changes:

validateChallenge now returns isValid instead of success