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

Add javascript response formatters as a package? #19

Closed
Firehed opened this issue Nov 3, 2022 · 1 comment
Closed

Add javascript response formatters as a package? #19

Firehed opened this issue Nov 3, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@Firehed
Copy link
Owner

Firehed commented Nov 3, 2022

There are two small but important pieces of JS code that are format specific, for the credentials.create and credentials.get response parsing. It would be beneficial to publish these (as a NPM package, presumably) to ensure the conversion process is reliable.

Something like this:

export const parseAttestation = (attestation: AuthenticatorAttestationResponse) => ({
    rawId: Array.from(new Uint8Array(attestation.rawId)),
    type: credential.type,
    attestationObject: Array.from(new Uint8Array(attestation.attestationObject)),
    clientDataJSON: Array.from(new Uint8Array(attestation.clientDataJSON)),
})

export const parseAssertion = (assertion: AuthenticatorAssertionResponse) => ({
    rawId: Array.from(new Uint8Array(assertion.rawId)),
    type: assertion.type,
    authenticatorData: Array.from(new Uint8Array(assertion.authenticatorData)),
    clientDataJSON: Array.from(new Uint8Array(assertion.clientDataJSON)),
    signature: Array.from(new Uint8Array(assertion.signature)),
    userHandle: Array.from(new Uint8Array(assertion.userHandle!)),
})
@Firehed Firehed added the enhancement New feature or request label Nov 3, 2022
@Firehed
Copy link
Owner Author

Firehed commented Nov 15, 2023

I feel this is obsolete with #41 - that's pretty clearly a superior direction that will have better native support and require less maintenance on my end.

@Firehed Firehed closed this as completed Nov 15, 2023
@Firehed Firehed closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant