Siwe

Latest version: v4.0.0

Safety actively analyzes 623677 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

2.1.4

- Adds support to `ethers6` alongside with `ethers5` and raises minimum version to 5.6.8 due to relevant security fix. (147)
- Adds setup for Node 18 and updates CI (146)

2.1.3beta

This restores previous behavior for `issuedAt` where it was optional and by default set to `new Date().toISOString()`.

2.1.2beta

Dropping support for RegExp
Due to small inconsistencies between the ABNF grammar and the RegExp parser it was decided that it will no longer be supported and as of this version was removed. (120)

Library improvements
With this release is now possible to extend the behavior of the `verify` function. Using the argument `verificationFallback` in the `VerifyOpts` object makes it possible to create a custom condition for verifying a SIWE message in case of failure (85).

`verificationFallback` requires a function that has the same return as `verify` (`Promise<SiweResponse>`) and is provided with four arguments, those being:
- `params: VerifyParams`: same params used in the `verify` call;
- `opts: VerifyOpts`: same opts used in the `verify` call;
- `message: SiweMessage`: the message currently being verified by `verify`;
- `EIP1271Promise: Promise<SiweResponse>`: the result of the verification if the message was signed by a SmartContract Wallet.

Thanks to 99 a big performance upgrade was also possible making the library even better.

Additional tests were also introduced, additional checks and safeguards and general improvements to code quality.
- 95
- 96
- 102
- 104
- 109
- 105
- 110
- 112
- 119
- 121
- 122
- 123
- 124
- 126
- 127

2.0.5beta

Fix

* Fixes a build issue from `2.0.4` where a `dist` folder with nested files was created from an added flag to enable typing for the JSON tests. These issues have since been resolved (91).

2.0.4beta

To improve code quality and allow for easier contribution two new scripts to check for code smells and lint the code were added to `package.json`:
- `lint`, which checks for code smells.
- `format`, which fixes code accordingly to lint and format rules.

The deprecated function `validate()` was returning the result of the new function `verify()`, which was not the previous behavior therefore it is being fixed on this release to return the previous object (`SiweMessage`), tests were also added to make sure existing behavior will be maintained while this function is supported.

2.0.3beta

SIWE 2.0 has been released. The interfaces have been updated to allow consistent usage across languages for SIWE message parsing, creation, and verification. Message parsing has been split into its own package, `siwe-parser`, allowing implementers to utilize this functionality standalone without importing larger cryptographic dependencies.

As a result, this update introduces the following breaking changes (hence the major version update) and implements stricter checks from the EIP-4361 specification:

- `validate(…)` was deprecated and renamed to `verify(…)` with a new API. A backwards-compatible helper function exists to allow existing implementers to upgrade without concern for changed behavior, but SIWE 1.0 users are advised to review the upgrade section below.
- `ethers` has been updated to a peer dependency, allowing for more efficient builds.
- EIP-55 validation of EIP-155 is now enforced, and non-EIP-155 messages are considered as invalid.
- The `type` and `signature` properties have been removed from `SiweMessage`.
- The `not-before` message field is now checked during `verify`.
- This update introduces more granular error types returned after verification or message parsing failures: `EXPIRED_MESSAGE`, `INVALID_DOMAIN`, `DOMAIN_MISMATCH`, `NONCE_MISMATCH`, `INVALID_ADDRESS`, `INVALID_URI`, `INVALID_NONCE`, `NOT_YET_VALID_MESSAGE`, `INVALID_SIGNATURE`, `INVALID_TIME_FORMAT`, `INVALID_MESSAGE_VERSION`, and `UNABLE_TO_PARSE`.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.