Skip to content

Commit 877d965

Browse files
committed
Version bump
1 parent 1fbd764 commit 877d965

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1+
[![npm](https://img.shields.io/npm/v/@queue-it/queue-token)](https://www.npmjs.com/package/@queue-it/queue-token)
12

3+
# Queue-it Queue Token SDK for JavaScript
24

3-
# Queue-it Queue Token SDK for JavaScript
45
The Queue-it Queue Token SDK is used to ensure that end users cannot enter the queue without a valid token and to be a container which can car-ry sensitive user information from integrating system into the queue. The token can be issued by any application that supports JAVA 1.6+.
6+
57
## The Token
8+
69
The token consists of two parts. Firstly, a header containing non-sensitive metadata. Secondly the payload of the token.
710
Both header and payload are in JSON format.
11+
812
### Token Header
9-
```
10-
{
13+
14+
```json
15+
{
1116
"typ": "QT1",
1217
"enc": "AES256",
1318
"iss": 1526464517,
1419
"exp": 1526524517,
1520
"ti": "159aba3e-55e1-4f54-b6ee-e5b943d7e885",
16-
"c": "ticketania",
21+
"c": "ticketania",
1722
"e": "demoevent",
1823
"ip": "75.86.129.4",
1924
"xff": "45.67.2.4,34.56.3.2"
2025
}
2126
```
27+
2228
- `typ`: The type of the token. Value must be "QFT1". Required.
2329
- `enc`: Payload encryption algorithm. Value must be "AES256". Required.
2430
- `iss`: NumericDate of when token was issued. Required.
@@ -30,13 +36,15 @@ Both header and payload are in JSON format.
3036
- `xff`: The X-Forwarded-For headerof the request when the token is issued. If provided, the X-Forwarded-For header is validated before issuing the token. Optional.
3137

3238
### Token Payload
33-
```
34-
{
39+
40+
```json
41+
{
3542
"r": 0.4578,
3643
"k": "XKDI42W",
3744
"cd": { "size": "medium" }
3845
}
3946
```
47+
4048
- `r`: The relative quality of the key. Must be a decimal value. Used for determining the quality of the token. Optional
4149
- `k`: A unique key that holds value to the integrating system (e.g. email or user id). Used to restrict users from issuing multiple queue ids. Optional.
4250
- `cd`: Any custom data of the user. This is a set of key-value pairs. Optional
@@ -62,6 +70,7 @@ const tokenValue = token.Token;
6270
```
6371

6472
### Specifying token identifier prefix
73+
6574
A prefix for the token identifier can optionally be provided to restrict the user session after getting through the queue to the one used before entering the queue. Once the user is through the queue the token identifier is provided to the target application in the Known User token. The format of the token identifier is then `[YOUR PREFIX]~[GUID]`, e.g: AnfTDnpwazllYmnmgaCJ8tErV80YHv77ni5NgqQNhfWwxNqrNcHb~e937ef0d-48ec-4ff7-866e-52033273cb3d.
6675

6776
```javascript
@@ -75,10 +84,11 @@ const tokenIdentifier = token.TokenIdentifier;
7584
```
7685

7786
## Serialized Token
87+
7888
> eyJ0eXAiOiJRVDEiLCJlbmMiOiJBRVMyNTYiLCJpc3MiOjE1MzQ3MjMyMDAwMDAsImV4cCI6MTUzOTEyOTYwMDAwMCwidGkiOiJhMjFkNDIzYS00M2ZkLTQ4MjEtODRmYS00MzkwZjZhMmZkM2UiLCJjIjoidGlja2V0YW5pYSIsImUiOiJteWV2ZW50In0.0rDlI69F1Dx4Twps5qD4cQrbXbCRiezBd6fH1PVm6CnVY456FALkAhN3rgVrh_PGCJHcEXN5zoqFg65MH8WZc_CQdD63hJre3Sedu0-9zIs.aZgzkJm57etFaXjjME_-9LjOgPNTTqkp1aJ057HuEiU
7989
80-
The format of the token is [header].[payload].[hash] where each part is Base64Url encoded.
81-
The payload is AES 256 encrypted with the secret key supplied in the `.Generate(secretKey)` method.
82-
If the "e" key is provided in the header, the secret key on the event must be used.
90+
The format of the token is [header].[payload].[hash] where each part is Base64Url encoded.
91+
The payload is AES 256 encrypted with the secret key supplied in the `.Generate(secretKey)` method.
92+
If the "e" key is provided in the header, the secret key on the event must be used.
8393
If no "e" key is provided the default key on the customer account must be used.
8494
The token is signed with SHA 256 using the same secret key.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@queue-it/enqueue-token",
3-
"version": "1.0.0",
2+
"name": "@queue-it/queue-token",
3+
"version": "1.0.1",
44
"description": "Ensures that end users cannot enter the queue without a valid token and to be a container which can carry sensitive user information from integrating system into the queue",
55
"repository": "https://github.com/queueit/QueueToken.V1.JavaScript",
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)