Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve strict auth API so that we can require both a unique auth key and a genuine user interaction #134

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading