-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
4,168 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
src/**/*.test.ts | ||
node_modules | ||
coverage | ||
dist | ||
debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
}, | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended-type-checked', | ||
'plugin:@typescript-eslint/stylistic-type-checked', | ||
], | ||
plugins: ['@typescript-eslint'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: ['./tsconfig.json'], | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
}, | ||
root: true, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: 'npm test' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- run: npm install -g pnpm | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
cache: 'pnpm' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: | | ||
pnpm install | ||
pnpm lint | ||
pnpm test | ||
pnpm build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: 'npm test && publish' | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- run: npm install -g pnpm | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
cache: 'pnpm' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: | | ||
pnpm install | ||
pnpm lint | ||
pnpm test | ||
pnpm build | ||
- run: npm publish . | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,38 @@ | ||
# cose-ts | ||
Implemented Keys, Algorithms (RFC9053), COSE (RFC9052) and CWT (RFC8392) in TypeScript. | ||
# Keys, Algorithms, COSE and CWT in TypeScript | ||
|
||
[![CI](https://github.com/ldclabs/cose-ts/actions/workflows/ci.yml/badge.svg)](https://github.com/ldclabs/cose-ts/actions/workflows/ci.yml) | ||
[![Codecov](https://codecov.io/gh/ldclabs/cose-ts/branch/main/graph/badge.svg)](https://codecov.io/gh/ldclabs/cose-ts) | ||
[![CodeQL](https://github.com/ldclabs/cose-ts/actions/workflows/codeql.yml/badge.svg)](https://github.com/ldclabs/cose-ts/actions/workflows/codeql.yml) | ||
[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/ldclabs/cose-ts/main/LICENSE) | ||
|
||
*A golang library for the [CBOR Object Signing and Encryption (COSE)][cose-spec] and [CBOR Web Token (CWT)][cwt-spec].* | ||
|
||
Golang version: [https://github.com/ldclabs/cose](https://github.com/ldclabs/cose) | ||
Rust version: [https://github.com/google/coset](https://github.com/google/coset) | ||
|
||
## Security Reviews | ||
|
||
Todo. | ||
|
||
## Reference | ||
|
||
1. [RFC9052: CBOR Object Signing and Encryption (COSE)][cose-spec] | ||
2. [RFC8392: CBOR Web Token (CWT)][cwt-spec] | ||
3. [RFC9053: CBOR Object Signing and Encryption (COSE): Initial Algorithms][algorithms-spec] | ||
4. [IANA: CBOR Object Signing and Encryption (COSE)][iana-cose] | ||
5. [IANA: CBOR Web Token (CWT) Claims][iana-cwt] | ||
6. [IANA: Concise Binary Object Representation (CBOR) Tags][iana-cbor-tags] | ||
|
||
|
||
[cbor]: https://datatracker.ietf.org/doc/html/rfc8949 | ||
[cose-spec]: https://datatracker.ietf.org/doc/html/rfc9052 | ||
[cwt-spec]: https://datatracker.ietf.org/doc/html/rfc8392 | ||
[algorithms-spec]: https://datatracker.ietf.org/doc/html/rfc9053 | ||
[iana-cose]: https://www.iana.org/assignments/cose/cose.xhtml | ||
[iana-cwt]: https://www.iana.org/assignments/cwt/cwt.xhtml | ||
[iana-cbor-tags]: https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml | ||
|
||
## License | ||
Copyright © 2022-2024 [LDC Labs](https://github.com/ldclabs). | ||
|
||
ldclabs/cose is licensed under the MIT License. See [LICENSE](LICENSE) for the full license text. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{ | ||
"name": "@ldclabs/cose-ts", | ||
"type": "module", | ||
"version": "0.1.0", | ||
"author": "0xZensh <[email protected]>", | ||
"description": "Implemented Keys, Algorithms (RFC9053), COSE (RFC9052) and CWT (RFC8392) in TypeScript.", | ||
"license": "MIT", | ||
"homepage": "https://github.com/ldclabs/cose-ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ldclabs/cose-ts.git" | ||
}, | ||
"files": [ | ||
"dist", | ||
"package.json", | ||
"LICENSE", | ||
"README.md" | ||
], | ||
"main": "dist/index.js", | ||
"typings": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"browser": "./dist/index.js", | ||
"default": "./dist/index.js" | ||
}, | ||
"./aesgcm": { | ||
"types": "./dist/aesgcm.d.ts", | ||
"browser": "./dist/aesgcm.js", | ||
"default": "./dist/aesgcm.js" | ||
}, | ||
"./encrypt0": { | ||
"types": "./dist/encrypt0.d.ts", | ||
"browser": "./dist/encrypt0.js", | ||
"default": "./dist/encrypt0.js" | ||
}, | ||
"./iana": { | ||
"types": "./dist/iana.d.ts", | ||
"browser": "./dist/iana.js", | ||
"default": "./dist/iana.js" | ||
}, | ||
"./key": { | ||
"types": "./dist/key.d.ts", | ||
"browser": "./dist/key.js", | ||
"default": "./dist/key.js" | ||
}, | ||
"./map": { | ||
"types": "./dist/map.d.ts", | ||
"browser": "./dist/map.js", | ||
"default": "./dist/map.js" | ||
}, | ||
"./tag": { | ||
"types": "./dist/tag.d.ts", | ||
"browser": "./dist/tag.js", | ||
"default": "./dist/tag.js" | ||
}, | ||
"./utils": { | ||
"types": "./dist/utils.d.ts", | ||
"browser": "./dist/utils.js", | ||
"default": "./dist/utils.js" | ||
} | ||
}, | ||
"browser": { | ||
"node:crypto": false | ||
}, | ||
"engines": { | ||
"node": ">=18.0.0" | ||
}, | ||
"scripts": { | ||
"build": "npm run clean && tsc -p tsconfig.json", | ||
"clean": "rm -rf dist", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix", | ||
"test": "vitest src --coverage --run" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.11.0", | ||
"@typescript-eslint/eslint-plugin": "^6.18.1", | ||
"@typescript-eslint/parser": "^6.18.1", | ||
"@vitest/coverage-v8": "^1.2.0", | ||
"cborg": "^4.0.7", | ||
"eslint": "^8.56.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"typescript": "^5.3.3", | ||
"vitest": "^1.2.0" | ||
}, | ||
"keywords": [ | ||
"cose", | ||
"cbor", | ||
"RFC9052", | ||
"RFC9053" | ||
], | ||
"dependencies": { | ||
"@noble/ciphers": "=0.4.1" | ||
} | ||
} |
Oops, something went wrong.