Skip to content

Commit

Permalink
feat: rename package
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Oct 1, 2019
1 parent 6f8eff0 commit 26f4cf2
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 48 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bug report
about: There's a bug in @panva/jose I want to report
about: There's a bug I want to report
title: 'bug: '
labels: bug
---
Expand All @@ -21,11 +21,11 @@ Steps to reproduce the behaviour:
A clear and concise description of what you expected to happen.

**Environment:**
- @panva/jose version: [e.g. v1.0.0]
- `jose` version: [e.g. v1.0.0]
- node version: [e.g. v12.0.0]

**Additional context**
Add any other context about the problem here.

- [ ] the bug is happening on latest @panva/jose too.
- [ ] the bug is happening on latest `jose` too.
- [ ] i have searched the issues tracker on github for similar issues and couldn't find anything related.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Feature proposal
about: I have an idea for a new @panva/jose feature
about: I have an idea for a new feature
title: 'proposal: '
labels: enhancement
---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Question
about: I have a question about using @panva/jose
about: I have a question about using jose
title: 'question: '
labels: question
---
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ The new methods still allow to import private RSA keys with these
optimization key parameters missing but it is disabled by default and one
should choose to enable it when working with keys from trusted sources

It is recommended not to use @panva/jose versions with this feature in
It is recommended not to use `jose` versions with this feature in
its original on-by-default form - v1.1.0 and v1.2.0


Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to @panva/jose
# Contributing to `jose`

Please note we have a [code of conduct][coc], please follow it in all your interactions with the
project.
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @panva/jose
# jose

![build][actions-image] [![codecov][codecov-image]][codecov-url]

Expand All @@ -8,7 +8,7 @@

## Implemented specs & features

The following specifications are implemented by @panva/jose
The following specifications are implemented by `jose`

- JSON Web Signature (JWS) - [RFC7515][spec-jws]
- JSON Web Encryption (JWE) - [RFC7516][spec-jwe]
Expand Down Expand Up @@ -104,7 +104,7 @@ Won't implement:

<br>

Have a question about using @panva/jose? - [ask][ask].
Have a question about using `jose`? - [ask][ask].
Found a bug? - [report it][bug].
Missing a feature? - If it wasn't already discussed before, [ask for it][suggest-feature].
Found a vulnerability? - Reach out to us via email first, see [security vulnerability disclosure][security-vulnerability].
Expand All @@ -115,11 +115,11 @@ Found a vulnerability? - Reach out to us via email first, see [security vulnerab

## Support

If you or your business use @panva/jose, please consider becoming a [sponsor][support-sponsor] so I can continue maintaining it and adding new features carefree.
If you or your business use `jose`, please consider becoming a [sponsor][support-sponsor] so I can continue maintaining it and adding new features carefree.

## Documentation

- [@panva/jose API Documentation][documentation]
- [jose API Documentation][documentation]
- [JWK (JSON Web Key)][documentation-jwk]
- [JWKS (JSON Web Key Set)][documentation-jwks]
- [JWT (JSON Web Token)][documentation-jwt]
Expand All @@ -131,22 +131,22 @@ If you or your business use @panva/jose, please consider becoming a [sponsor][su
For the best performance Node.js version **>=12.0.0** is recommended, but **^10.13.0** lts/dubnium
is also supported.

Installing @panva/jose
Installing `jose`

```console
npm install @panva/jose
npm install jose
```

Usage
```js
const jose = require('@panva/jose')
const jose = require('jose')
const {
JWE, // JSON Web Encryption (JWE)
JWK, // JSON Web Key (JWK)
JWKS, // JSON Web Key Set (JWKS)
JWS, // JSON Web Signature (JWS)
JWT, // JSON Web Token (JWT)
errors // errors utilized by @panva/jose
errors // errors utilized by jose
} = jose
```

Expand Down Expand Up @@ -238,7 +238,7 @@ jose.JWT.verify(

Note: Depending on the channel you receive an ID Token from the following claims may be required
and must also be checked: `at_hash`, `c_hash` or `s_hash`. Use e.g. [`oidc-token-hash`][oidc-token-hash]
to validate those hashes after getting the ID Token payload and signature validated by @panva/jose.
to validate those hashes after getting the ID Token payload and signature validated by `jose`

#### JWS Signing

Expand Down Expand Up @@ -295,21 +295,21 @@ Note: the secp256k1 JOSE parameters registration and the RFC is still in a draft
draft changes its mind about the parameter names again the new values will be propagated as a MINOR
library version.

When you require `@panva/jose` you can work with `secp256k1` EC keys right away, the EC JWK `crv`
When you require `jose` you can work with `secp256k1` EC keys right away, the EC JWK `crv`
used is as per the specification `secp256k1`.

```js
const jose = require('@panva/jose')
const jose = require('jose')
let key = jose.JWK.generateSync('EC', 'secp256k1')
key = jose.JWK.asKey(fs.readFileSync('path/to/key/file'))
key.crv === 'secp256k1'
```

For legacy reasons the unregistered EC JWK `crv` value `P-256K` is also supported but you must
require `@panva/jose` like so to use it:
require `jose` like so to use it:

```js
const jose = require('@panva/jose/P-256K')
const jose = require('jose/P-256K')
let key = jose.JWK.generateSync('EC', 'P-256K')
key = jose.JWK.asKey(fs.readFileSync('path/to/key/file'))
key.crv === 'P-256K'
Expand Down Expand Up @@ -338,7 +338,7 @@ private API and is subject to change between any versions.

#### How do I use it outside of Node.js

It is **only built for ^10.13.0 || >=12.0.0 Node.js** environment - including @panva/jose in
It is **only built for ^10.13.0 || >=12.0.0 Node.js** environment - including `jose` in
transpiled browser-environment targeted projects is not supported and may result in unexpected
results.

Expand Down
50 changes: 25 additions & 25 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @panva/jose API Documentation
# `jose` API Documentation

> "JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS for Node.js with minimal dependencies
Expand All @@ -17,7 +17,7 @@

## Support

If you or your business use @panva/jose, please consider becoming a [sponsor][support-sponsor] so I can continue maintaining it and adding new features carefree.
If you or your business use `jose`, please consider becoming a [sponsor][support-sponsor] so I can continue maintaining it and adding new features carefree.

<br>

Expand Down Expand Up @@ -52,12 +52,12 @@ If you or your business use @panva/jose, please consider becoming a [sponsor][su
- [JWK.isKey(object)](#jwkiskeyobject)
<!-- TOC JWK END -->

All @panva/jose operations require `<JWK.Key>` or `<JWKS.KeyStore>` as arguments. Here's
All `jose` operations require `<JWK.Key>` or `<JWKS.KeyStore>` as arguments. Here's
how to get a `<JWK.Key>` instances generated or instantiated from existing key material.


```js
const { JWK } = require('@panva/jose')
const { JWK } = require('jose')
// { asKey: [Function: asKey],
// generate: [AsyncFunction: generate],
// generateSync: [Function: generateSync] }
Expand Down Expand Up @@ -211,7 +211,7 @@ of algorithms the key may perform.
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWK: { generateSync } } = require('@panva/jose')
const { JWK: { generateSync } } = require('jose')

const privateKey = generateSync('RSA')
privateKey.algorithms()
Expand Down Expand Up @@ -257,7 +257,7 @@ Exports the key to a JSON Web Key formatted object.
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWK: { generateSync } } = require('@panva/jose')
const { JWK: { generateSync } } = require('jose')

const key = generateSync('RSA', 2048, { use: 'sig', alg: 'PS256' })
key.toJWK()
Expand Down Expand Up @@ -317,7 +317,7 @@ For private key export, the following encoding options can be used:
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWK: { generateSync } } = require('@panva/jose')
const { JWK: { generateSync } } = require('jose')

const key = generateSync('RSA', 2048)
key.toPEM()
Expand Down Expand Up @@ -363,7 +363,7 @@ formats

```js
const { readFileSync } = require('fs')
const { JWK: { asKey } } = require('@panva/jose')
const { JWK: { asKey } } = require('jose')

const key = asKey(readFileSync('path/to/key/file'))
// ECKey {
Expand Down Expand Up @@ -395,7 +395,7 @@ Imports a symmetric key.
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWK: { asKey } } = require('@panva/jose')
const { JWK: { asKey } } = require('jose')

const key = asKey(Buffer.from('8yHym6h5CG5FylbzrCn8fhxEbp3kOaTsgLaawaaJ'))
// OctKey {
Expand Down Expand Up @@ -442,7 +442,7 @@ keys may be both private and public.
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWK: { asKey } } = require('@panva/jose')
const { JWK: { asKey } } = require('jose')
const jwk = {
kty: 'RSA',
kid: 'r1LkbBo3925Rb2ZFFrKyU3MVex9T2817Kx0vbi6i_Kc',
Expand Down Expand Up @@ -489,7 +489,7 @@ Securely generates a new RSA, EC, OKP or oct key.
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWK: { generate } } = require('@panva/jose')
const { JWK: { generate } } = require('jose')
(async () => {
const key = await generate('EC', 'P-384', { use: 'sig' })
// ECKey {
Expand Down Expand Up @@ -532,7 +532,7 @@ Synchronous version of `JWK.generate()`
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWK: { generateSync } } = require('@panva/jose')
const { JWK: { generateSync } } = require('jose')
const key = generateSync('RSA', 2048, { use: 'enc' })
// RSAKey {
// kty: 'RSA',
Expand Down Expand Up @@ -578,7 +578,7 @@ Returns 'true' if the value is an instance of `<JWK.Key>`.
<!-- TOC JWKS END -->

```js
const { JWKS } = require('@panva/jose')
const { JWKS } = require('jose')
// { KeyStore: [Function: KeyStore] }
```

Expand Down Expand Up @@ -702,7 +702,7 @@ Creates a new KeyStore from a JSON Web Key Set.
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWKS: { KeyStore, asKeyStore } } = require('@panva/jose')
const { JWKS: { KeyStore, asKeyStore } } = require('jose')
const jwks = {
keys: [
{ kty: 'RSA',
Expand Down Expand Up @@ -733,7 +733,7 @@ ks instanceof KeyStore
<!-- TOC JWT END -->

```js
const { JWT } = require('@panva/jose')
const { JWT } = require('jose')
// { decode: [Function], sign: [Function], verify: [Function] }
```

Expand Down Expand Up @@ -774,7 +774,7 @@ that will be used to sign with is either provided as part of the 'options.algori
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWT, JWK } = require('@panva/jose')
const { JWT, JWK } = require('jose')
const key = JWK.asKey({
kty: 'oct',
k: 'hJtXIZ2uSN5kbQfbtTNWbpdmhkV8FJG-Onbc6mxCcYg'
Expand Down Expand Up @@ -847,7 +847,7 @@ Verifies the claims and signature of a JSON Web Token.
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWK, JWT } = require('@panva/jose')
const { JWK, JWT } = require('jose')

const key = JWK.asKey({
kty: 'oct',
Expand Down Expand Up @@ -881,7 +881,7 @@ ever.
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWT } = require('@panva/jose')
const { JWT } = require('jose')

const token = 'eyJ0eXAiOiJKV1QiLCJraWQiOiJSdG9SdXJfMURpcjVNNHd1T2ZxTmtEWU9mOU9fNFJKLWFIa1RBNzVSTEE4IiwiYWxnIjoiSFMyNTYifQ.eyJ1cm46ZXhhbXBsZTpjbGFpbSI6ImZvbyIsImF1ZCI6WyJ1cm46ZXhhbXBsZTpjbGllbnQiXSwiaXNzIjoiaHR0cHM6Ly9vcC5leGFtcGxlLmNvbSIsImlhdCI6MTU1MTI5NDEzNywiZXhwIjoxNTUxMzAxMzM3fQ.YmtApwaGRBWlL9O8avbmpYcJ5UwNy0R8rpbxZqHxNd4'

Expand Down Expand Up @@ -924,7 +924,7 @@ The `<JWS>` module provides methods required to sign or verify JSON Web Signatur
the defined serializations.

```js
const { JWS } = require('@panva/jose')
const { JWS } = require('jose')
// { Sign: [Function: Sign],
// sign:
// { [Function: bound single]
Expand All @@ -941,7 +941,7 @@ signatures of the same payload) using the General JWS JSON Serialization Syntax.
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWK, JWS } = require('@panva/jose')
const { JWK, JWS } = require('jose')

const key = JWK.asKey({
kty: 'oct',
Expand Down Expand Up @@ -1024,7 +1024,7 @@ provided `<JWK.Key>` instance.
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWK, JWS } = require('@panva/jose')
const { JWK, JWS } = require('jose')

const key = JWK.asKey({
kty: 'oct',
Expand Down Expand Up @@ -1058,7 +1058,7 @@ inferred from the provided `<JWK.Key>` instance.
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWK, JWS } = require('@panva/jose')
const { JWK, JWS } = require('jose')

const key = JWK.asKey({
kty: 'oct',
Expand Down Expand Up @@ -1100,7 +1100,7 @@ Verifies the provided JWS in either serialization with a given `<JWK.Key>` or `<
<summary><em><strong>Example</strong></em> (Click to expand)</summary>

```js
const { JWK, JWS, JWKS } = require('@panva/jose')
const { JWK, JWS, JWKS } = require('jose')

const key = JWK.asKey({
kty: 'oct',
Expand Down Expand Up @@ -1181,7 +1181,7 @@ The `<JWE>` module provides methods required to encrypt or decrypt JSON Web Encr
one of the defined serializations.

```js
const { JWE } = require('@panva/jose')
const { JWE } = require('jose')
// { Encrypt: [Function: Encrypt],
// encrypt:
// { [Function: bound single]
Expand Down Expand Up @@ -1303,7 +1303,7 @@ Verifies the provided JWE in either serialization with a given `<JWK.Key>` or `<
<!-- TOC Errors END -->


The following errors are expected to be thrown by @panva/jose runtime and have their prototypes
The following errors are expected to be thrown by `jose` runtime and have their prototypes
exported in `jose.errors`. If you encounter an `Error` other then `TypeError` or one that's
`instanceof jose.errors.JOSEError` please [report it][bug], it is not intended.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@panva/jose",
"name": "jose",
"version": "1.9.2",
"description": "JSON Web Almost Everything - JWA, JWS, JWE, JWK, JWT, JWKS for Node.js with minimal dependencies",
"keywords": [
Expand Down

0 comments on commit 26f4cf2

Please sign in to comment.