akey-electron-webauthn-macos 1.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ import type { _NSArray, _NSData, _NSObject, _NSSecureCoding } from "objcjs-types/Foundation";
2
+ export declare class _ASCPublicKeyCredentialDescriptor extends _NSObject {
3
+ static alloc(): _ASCPublicKeyCredentialDescriptor;
4
+ static new(): _ASCPublicKeyCredentialDescriptor;
5
+ init(): _ASCPublicKeyCredentialDescriptor;
6
+ initWithCredentialID$transports$(credentialID: _NSData, allowedTransports: _NSArray | null): _ASCPublicKeyCredentialDescriptor;
7
+ credentialID(): _NSData;
8
+ transports(): _NSArray | null;
9
+ }
10
+ export interface _ASCPublicKeyCredentialDescriptor extends _NSSecureCoding {
11
+ }
12
+ export declare const ASCPublicKeyCredentialDescriptor: typeof _ASCPublicKeyCredentialDescriptor;
@@ -0,0 +1,10 @@
1
+ import { NobjcObject } from "objc-js";
2
+ import type { ExcludeCredential } from "./internal-handler.js";
3
+ import type { ASAuthorizationController } from "objcjs-types/AuthenticationServices";
4
+ export interface PublicKeyCredentialParams {
5
+ type: "public-key";
6
+ algorithm: number;
7
+ }
8
+ export declare function setControllerState(self: NobjcObject, clientDataHash: Buffer, pubKeyCredParams: PublicKeyCredentialParams[], residentKeyRequired: boolean, excludeCredentialIds: ExcludeCredential[]): void;
9
+ export declare function removeControllerState(self: NobjcObject): void;
10
+ export declare const WebauthnCreateController: typeof ASAuthorizationController;
@@ -0,0 +1,2 @@
1
+ import type { CreateCredentialResult, WebauthnCreateRequestOptions } from "akey-electron-webauthn-types";
2
+ export declare function createCredential(publicKeyOptions: PublicKeyCredentialCreationOptions | undefined, additionalOptions: WebauthnCreateRequestOptions): Promise<CreateCredentialResult>;
@@ -0,0 +1,36 @@
1
+ import { type PRFInput } from "../helpers/prf.js";
2
+ import { type PublicKeyCredentialParams } from "./authorization-controller.js";
3
+ export type AuthenticatorAttachmentWithExtra = AuthenticatorAttachment | "all";
4
+ export interface CreateCredentialResult {
5
+ credentialId: Buffer;
6
+ clientDataJSON: Buffer;
7
+ attestationObject: Buffer;
8
+ authenticatorData: Buffer;
9
+ attachment: AuthenticatorAttachment;
10
+ transports: string[];
11
+ isResidentKey: boolean;
12
+ publicKeyAlgorithm: number;
13
+ publicKey: Buffer;
14
+ isLargeBlobSupported: boolean | null;
15
+ isPRFSupported: boolean | null;
16
+ prfFirst: Buffer | null;
17
+ prfSecond: Buffer | null;
18
+ }
19
+ type CredentialUserVerificationPreference = "required" | "preferred" | "discouraged";
20
+ type CredentialAttestationPreference = "direct" | "enterprise" | "indirect" | "none";
21
+ declare const VALID_EXTENSIONS: readonly ["largeBlob", "prf"];
22
+ export type CredentialCreationExtensions = (typeof VALID_EXTENSIONS)[number];
23
+ export type LargeBlobSupport = "required" | "preferred" | "unspecified";
24
+ interface CreateCredentialAdditionalOptions {
25
+ allowSecurityKeyRequests?: boolean;
26
+ topFrameOrigin?: string;
27
+ userDisplayName?: string;
28
+ largeBlobSupport?: LargeBlobSupport;
29
+ prf?: PRFInput;
30
+ }
31
+ export interface ExcludeCredential {
32
+ id: Buffer;
33
+ transports?: string[];
34
+ }
35
+ declare function createCredentialInternal(rpid: string, challenge: Buffer, username: string, userID: Buffer, nativeWindowHandle: Buffer, origin: string, timeout: number, enabledExtensions: CredentialCreationExtensions[], attestation: CredentialAttestationPreference, supportedAlgorithmIdentifiers: PublicKeyCredentialParams[], excludeCredentials: ExcludeCredential[], residentKeyRequired?: boolean, preferredAuthenticatorAttachment?: AuthenticatorAttachmentWithExtra, userVerification?: CredentialUserVerificationPreference, additionalOptions?: CreateCredentialAdditionalOptions): Promise<CreateCredentialResult>;
36
+ export { createCredentialInternal };
@@ -0,0 +1,5 @@
1
+ import { NobjcObject } from "objc-js";
2
+ import type { ASAuthorizationController } from "objcjs-types/AuthenticationServices";
3
+ export declare function setClientDataHash(self: NobjcObject, clientDataHash: Buffer): void;
4
+ export declare function removeClientDataHash(self: NobjcObject): void;
5
+ export declare const WebauthnGetController: typeof ASAuthorizationController;
@@ -0,0 +1,2 @@
1
+ import type { GetCredentialResult, WebauthnGetRequestOptions } from "akey-electron-webauthn-types";
2
+ export declare function getCredential(publicKeyOptions: PublicKeyCredentialRequestOptions | undefined, additionalOptions: WebauthnGetRequestOptions): Promise<GetCredentialResult>;
@@ -0,0 +1,25 @@
1
+ import { type PRFInput } from "../helpers/prf.js";
2
+ import type { AuthenticatorAttachment } from "../helpers/types.js";
3
+ export type UserVerificationPreference = "preferred" | "required" | "discouraged";
4
+ declare const VALID_EXTENSIONS: readonly ["largeBlobRead", "largeBlobWrite", "prf"];
5
+ export type CredentialAssertionExtensions = (typeof VALID_EXTENSIONS)[number];
6
+ export interface GetCredentialResult {
7
+ id: Buffer;
8
+ authenticatorAttachment: AuthenticatorAttachment;
9
+ clientDataJSON: Buffer;
10
+ authenticatorData: Buffer;
11
+ signature: Buffer;
12
+ userHandle: Buffer;
13
+ prf: [Buffer | null, Buffer | null];
14
+ largeBlob: Buffer | null;
15
+ largeBlobWritten: boolean | null;
16
+ }
17
+ export interface GetCredentialAdditionalOptions {
18
+ allowSecurityKeyRequests?: boolean;
19
+ largeBlobDataToWrite?: Buffer;
20
+ prf?: PRFInput;
21
+ prfByCredential?: Record<string, PRFInput>;
22
+ topFrameOrigin?: string;
23
+ }
24
+ declare function getCredentialInternal(rpid: string, challenge: Buffer, nativeWindowHandle: Buffer, origin: string, timeout: number, enabledExtensions: CredentialAssertionExtensions[], allowedCredentialIds: Buffer[], userVerificationPreference?: UserVerificationPreference, additionalOptions?: GetCredentialAdditionalOptions): Promise<GetCredentialResult>;
25
+ export { getCredentialInternal };
@@ -0,0 +1,14 @@
1
+ interface WebauthnClientData {
2
+ type: "webauthn.get" | "webauthn.create";
3
+ challenge: string;
4
+ origin: string;
5
+ topOrigin?: string;
6
+ crossOrigin: boolean;
7
+ }
8
+ export declare function generateWebauthnClientData(type: "webauthn.get" | "webauthn.create", origin: string, challenge: Buffer, topFrameOrigin?: string): WebauthnClientData;
9
+ export declare function generateClientDataInfo(clientData: WebauthnClientData): {
10
+ clientDataJSON: string;
11
+ clientDataBuffer: Buffer<ArrayBuffer>;
12
+ clientDataHash: Buffer<ArrayBufferLike>;
13
+ };
14
+ export {};
@@ -0,0 +1,8 @@
1
+ export declare function PromiseWithResolvers<T = void>(): {
2
+ promise: Promise<T>;
3
+ resolve: (value: T | PromiseLike<T>) => void;
4
+ reject: (reason?: unknown) => void;
5
+ };
6
+ export declare function bufferToBase64Url(buffer: Buffer): string;
7
+ export declare function base64UrlToBuffer(b64url: string): Buffer;
8
+ export declare function bufferSourceToBuffer(src: BufferSource): Buffer | null;
@@ -0,0 +1,19 @@
1
+ export declare function serializeOrigin(origin: string): string | null;
2
+ type TupleOrigin = {
3
+ type: "tuple";
4
+ scheme: string;
5
+ host: string;
6
+ port: number | null;
7
+ };
8
+ type OpaqueOrigin = {
9
+ type: "opaque";
10
+ reason?: string;
11
+ };
12
+ type Origin = TupleOrigin | OpaqueOrigin;
13
+ export type OriginCompareOptions = {
14
+ allowOpaqueStringEquality?: boolean;
15
+ };
16
+ export declare function computeOrigin(input: string | URL): Origin;
17
+ export declare function isSameOrigin(a: string | URL, b: string | URL, opts?: OriginCompareOptions): boolean;
18
+ export declare function isCrossOrigin(a: string | URL, b: string | URL, opts?: OriginCompareOptions): boolean;
19
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { PasskeyAuthorizationError, PasskeyAuthorizationResult, PasskeyAuthorizationStatus } from "akey-electron-webauthn-types";
2
+ import { type _ASAuthorizationWebBrowserPublicKeyCredentialManager } from "objcjs-types/AuthenticationServices";
3
+ export interface ResolvePasskeyAuthorizationOptions {
4
+ requestIfNeeded: boolean;
5
+ manager?: _ASAuthorizationWebBrowserPublicKeyCredentialManager;
6
+ }
7
+ type PasskeyAuthorizationManagerFactory = () => _ASAuthorizationWebBrowserPublicKeyCredentialManager;
8
+ export declare function createPasskeyAuthorizationManager(): _ASAuthorizationWebBrowserPublicKeyCredentialManager;
9
+ export declare function resolvePasskeyAuthorization({ requestIfNeeded, manager, }: ResolvePasskeyAuthorizationOptions): Promise<PasskeyAuthorizationStatus>;
10
+ export declare function getListPasskeyAuthorizationStatus(): Promise<PasskeyAuthorizationResult | PasskeyAuthorizationError>;
11
+ export declare function requestListPasskeyAuthorization(): Promise<PasskeyAuthorizationResult | PasskeyAuthorizationError>;
12
+ export declare function __setPasskeyAuthorizationManagerFactoryForTesting(factory: PasskeyAuthorizationManagerFactory | null): void;
13
+ export {};
@@ -0,0 +1 @@
1
+ export declare function createPresentationContextProviderFromNativeWindowHandle(nativeWindowHandle: Buffer): import("objc-js").NobjcObject & import("objcjs-types/AuthenticationServices")._ASAuthorizationControllerPresentationContextProviding;
@@ -0,0 +1,5 @@
1
+ export interface PRFInput {
2
+ first: Buffer;
3
+ second?: Buffer;
4
+ }
5
+ export declare function createPRFInput(prf: PRFInput): import("objcjs-types/AuthenticationServices")._ASAuthorizationPublicKeyCredentialPRFAssertionInputValues;
@@ -0,0 +1 @@
1
+ export declare function encodeEC2PublicKeyToSPKI(x: bigint, y: bigint): Buffer;
@@ -0,0 +1,13 @@
1
+ export type RpIdCheckOptions = {
2
+ allowInsecureLocalhost?: boolean;
3
+ isPublicSuffix?: (domain: string) => boolean;
4
+ };
5
+ export type RpIdCheckResult = {
6
+ ok: true;
7
+ rpId: string;
8
+ } | {
9
+ ok: false;
10
+ rpId: string;
11
+ reason: string;
12
+ };
13
+ export declare function isRpIdAllowedForOrigin(origin: string, rpIdInput?: string, opts?: RpIdCheckOptions): RpIdCheckResult;
@@ -0,0 +1 @@
1
+ export type AuthenticatorAttachment = "platform" | "cross-platform";
@@ -0,0 +1,3 @@
1
+ export declare function isString(value: unknown): value is string;
2
+ export declare function isNumber(value: unknown): value is number;
3
+ export declare function isObject(value: unknown): boolean;
@@ -0,0 +1,4 @@
1
+ export * from "./get/handler.js";
2
+ export * from "./create/handler.js";
3
+ export * from "./list/handler.js";
4
+ export type * from "akey-electron-webauthn-types";