@anyit/token-dto
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@anyit/token-dto Library

The @anyit/token-dto library facilitates token management operations within the AnyIT platform, providing structured data transfer objects (DTOs) for creating and verifying tokens. This library is integrated with the @anyit/messaging system, allowing for seamless message-driven interactions.

Key Features

  • Token Creation and Verification: Supports operations for generating new tokens with custom claims and verifying existing tokens.
  • Flexible Claims Structure: Allows specifying custom claims as part of the token creation process.
  • Integration with Messaging: Leverages the @anyit/messaging infrastructure for sending and receiving token-related operations as messages.

Installation

To install the library:

yarn add @anyit/token-dto

Operations

  • CreateToken: Generates a new token based on provided payload, expiration, and claims.
  • VerifyToken: Validates a given token and extracts its payload and claims.

Message Properties

  • CreateToken
    • payload: The data to be encoded in the token.
    • expiresIn: Token expiration time.
    • claims: Additional claims to be included in the token.
    • token: The generated token (populated after token creation).
  • VerifyToken
    • token: The token to be verified.
    • payloadAndClaims: The payload and claims extracted from the token (populated after verification).

Contributing

Contributions to the @anyit/token-dto library are encouraged, especially to expand token management capabilities, enhance security features, and improve integration with other components of the AnyIT ecosystem.

License

This project is licensed under the MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i @anyit/token-dto

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

6.36 kB

Total Files

4

Last publish

Collaborators

  • anton.nagornyi