Skip to content

Commit

Permalink
Improve strict auth API so that we can require both a unique auth key…
Browse files Browse the repository at this point in the history
… and a genuine user interaction (#134)
  • Loading branch information
eligrey authored Jun 24, 2024
1 parent 964c85d commit 5a6b746
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Transcend Inc.",
"name": "@transcend-io/airgap.js-types",
"description": "TypeScript types for airgap.js interoperability with custom consent UIs",
"version": "10.13.0",
"version": "10.14.0",
"homepage": "https://github.com/transcend-io/airgap.js-types",
"repository": {
"type": "git",
Expand Down
9 changes: 6 additions & 3 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ export type AirgapAuthMap = {
interaction?: UIEvent;
/** Automatically reload the page if needed to remove CSP. `false` by default. */
autoReload?: boolean;
/**
* Additional authorization key automatically conferred by airgap.js via setAuth() API for UI modules.
* Required when optional strict authorization mode is enabled.
*/
key?: symbol;
};

/** Airgap authorization proof */
Expand All @@ -99,9 +104,7 @@ export type AirgapAuth =
/** A user-initiated interaction event that was just dispatched. */
| UIEvent
/** A `load` event from a just-loaded airgap.js script element (which implies auth by being loaded before airgap.js) */
| Event
/** Consent change authorization key automatically conferred by airgap via setAuth() API for UI modules */
| symbol;
| Event;

/** A boolean value represented as either `'on'` or `'off'` */
export const BooleanString = t.keyof({
Expand Down

0 comments on commit 5a6b746

Please sign in to comment.