0.7.9-beta.5 • Published 1 year ago

calimero-auth-sdk v0.7.9-beta.5

Weekly downloads
-
License
(MIT)
Repository
github
Last release
1 year ago

calimero-auth-sdk

Description

This SDK is used to generate Calimero Authentication Tokens. These tokens are used to grant the user access to selected Calimero private shard RPC endpoints.

How it works

Token data is generated based on user account ID and selected Calimero private shard ID, Token data also includes a start and expiry date (maximum duration of a single token is 30 days). This data is sent to My NEAR Wallet to be signed as a message (does not require a blockchain transaction, i.e. it's gas free).

Once the authorization service verifies that user account ID signed the message (containing token data), a Calimero Authorization Token is issued, allowing the user access to the selected Calimero private shard RPC endpoint.

Usage

Create CalimeroTokenData with the required data: accountId and shardId. Duration of the token:from and to fields are optional and default to Date.now() and Date.now() + MAX_CALIMERO_TOKEN_DURATION, respectively. Serialize the data using calimeroTokenDataInstance.serialize() and use this as the message parameter to be signed by My NEAR Wallet. Store data received from My NEAR Wallet in a WalletData instance.

Create a CalimeroToken with WalletData and CalimeroTokenData instances: calimeroToken = new CalimeroToken(walletData, calimeroTokenData.

Verify the signed message by calling calimeroToken.verify(). This will check both is the token is valid with respect to Date.now() and if the signature matches the public key of the user account ID.

Access to the Calimero private shard RPC endpoint should be given to tokens which return true from calimeroToken.verify().

0.7.6

1 year ago

0.7.8

1 year ago

0.7.7

1 year ago

0.7.9-beta.5

1 year ago

0.7.9-beta.0

1 year ago

0.7.9-beta.2

1 year ago

0.7.9-beta.1

1 year ago

0.7.9-beta.4

1 year ago

0.7.9-beta.3

1 year ago

0.7.4

2 years ago

0.7.3

2 years ago

0.7.5

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.5

2 years ago

0.6.4

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.16

2 years ago

0.5.15

2 years ago

0.5.14

2 years ago

0.5.13

2 years ago

0.5.12

2 years ago

0.5.11

2 years ago

0.5.10

2 years ago

0.5.9

2 years ago

0.5.8

2 years ago

0.5.7

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.6

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.8

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago