cybertoken 1.0.2 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # cybertoken [![CI](https://github.com/nikeee/cybertoken/actions/workflows/CI.yaml/badge.svg)](https://github.com/nikeee/cybertoken/actions/workflows/CI.yaml) [![npm badge](https://img.shields.io/npm/v/cybertoken)](https://www.npmjs.com/package/cybertoken)
1
+ # cybertoken [![CI](https://github.com/nikeee/cybertoken/actions/workflows/CI.yaml/badge.svg)](https://github.com/nikeee/cybertoken/actions/workflows/CI.yaml) [![CD](https://github.com/nikeee/cybertoken/actions/workflows/CD.yaml/badge.svg)](https://github.com/nikeee/cybertoken/actions/workflows/CI.yaml) [![npm badge](https://img.shields.io/npm/v/cybertoken)](https://www.npmjs.com/package/cybertoken)
2
2
 
3
- A token format for APIs inspired by the GitHub's API token format. Think of it as a standardized password format with some handy properties. Intended for API token and password generation.
3
+ A token format inspired by the GitHub's new API token format. Think of it as a standardized password format with some handy properties. Intended for API token and password generation.
4
4
 
5
5
  ## What is this?
6
6
 
@@ -85,7 +85,7 @@ myapitoken_161YNJQOaoFoWLaoXeMVHYyrSLhGPOjSBYBtxY6V3GqFFZKV
85
85
 
86
86
  Explanation:
87
87
 
88
- - `n-bytes` are `n` random bytes, but at least 21 (default: 30), generated by a cryptographically secure random source
88
+ - `n-bytes` are `n` random bytes, but at least 21 (default: 22), generated by a cryptographically secure random source
89
89
  - `v` is a single byte containing the version of the cybertoken format used (currently, only `0x00`)
90
90
  - The bytes are concatenated with the version and their CRC32 sum before base62 encoding
91
91
  - base62 alphabet used: `0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`
package/built/cli.d.ts CHANGED
@@ -1 +1,2 @@
1
+ #!/usr/bin/env node
1
2
  export {};
package/built/cli.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  var _a;
2
3
  import { createTokenGenerator } from "./index.js";
3
4
  const prefixWithoutUnderscore = (_a = process.argv[2]) !== null && _a !== void 0 ? _a : process.env.CYBERTOKEN_PREFIX;
package/built/index.js CHANGED
@@ -10,7 +10,7 @@ export function createTokenGenerator(options) {
10
10
  }
11
11
  const prefixWithUnderscore = options.prefixWithoutUnderscore + "_";
12
12
  const tokenPattern = getTokenPattern(prefixWithUnderscore);
13
- const tokenSecretByteCount = (_a = options.entropyBytes) !== null && _a !== void 0 ? _a : 30;
13
+ const tokenSecretByteCount = (_a = options.entropyBytes) !== null && _a !== void 0 ? _a : 22;
14
14
  if (tokenSecretByteCount <= 20) {
15
15
  throw new Error("The token secret byte count (`entropyBytes`) must be greater than 20.");
16
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cybertoken",
3
- "version": "1.0.2",
3
+ "version": "1.0.6",
4
4
  "description": "A token format for APIs inspired by the GitHub's API token format.",
5
5
  "author": "Niklas Mollenhauer",
6
6
  "license": "ISC",
@@ -14,7 +14,7 @@
14
14
  "test": "tsc --noEmit && vitest run",
15
15
  "test:coverage": "vitest run --coverage",
16
16
  "test:watch": "vitest watch --coverage",
17
- "prepare": "npm run clean && npm run compile"
17
+ "prepublishOnly": "npm run clean && npm run compile"
18
18
  },
19
19
  "keywords": [
20
20
  "token",