Skip to content

Commit

Permalink
add npm prepare script, fix verifiers, refactor helper methods (#9)
Browse files Browse the repository at this point in the history
* add npm prepare script

* fix verifier typo

* update fix for verifiers

* refactor and add some tests
  • Loading branch information
bucko13 committed Jun 22, 2021
1 parent fb025cf commit 86e9e89
Show file tree
Hide file tree
Showing 31 changed files with 248 additions and 1,294 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "10"
- "12"
cache: yarn
script:
- yarn lint
Expand Down
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"html.format.unformatted": "",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ function. `satisfyFinal` will test only the last caveat on a macaroon of the mat
and `satisfyPrevious` compares each caveat of the same condition against each other. This allows
more flexible attenuation where you can ensure, for example, that every "new" caveat is not less
restrictive than a previously added one. In the case of an expiration, you probably want to have a satisfier
that tests that a newer `expiration` is sooner than the first `expiration` added, otherwise, a client
could add their own expiration further into the future.
that tests that a newer `expiration` is sooner than the first `expiration` added, otherwise, a client could
add their own expiration further into the future.

The exported `Satisfier` interface described in the docs provides more details on creating
your own satisfiers

#### `verifyFirstPartyMacaroon`
#### `verifyMacaroonCaveats`

This can only be run by the creator of the macaroon since the signing secret is required to
verify the macaroon. This will run all necessary checks (requires satisfiers to be passed
Expand Down
71 changes: 0 additions & 71 deletions dist/caveat.d.ts

This file was deleted.

261 changes: 0 additions & 261 deletions dist/caveat.js

This file was deleted.

7 changes: 0 additions & 7 deletions dist/helpers.d.ts

This file was deleted.

Loading

0 comments on commit 86e9e89

Please sign in to comment.