diff options
author | Matthew Miller <matthew@millerti.me> | 2020-05-26 23:28:58 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2020-05-26 23:28:58 -0700 |
commit | e1d7c4e8b335333440322ef01b50405f39dc7f99 (patch) | |
tree | 9d0a81354c4715a06bf2dfb17d5f0407a3b9d430 | |
parent | 6e9857ac5032a7795a3b460d623f136cae08e12b (diff) |
Remove `authenticatorSelection` obfuscation
-rw-r--r-- | packages/server/src/attestation/generateAttestationOptions.test.ts | 4 | ||||
-rw-r--r-- | packages/server/src/attestation/generateAttestationOptions.ts | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/packages/server/src/attestation/generateAttestationOptions.test.ts b/packages/server/src/attestation/generateAttestationOptions.test.ts index 08507e7..723f5fc 100644 --- a/packages/server/src/attestation/generateAttestationOptions.test.ts +++ b/packages/server/src/attestation/generateAttestationOptions.test.ts @@ -83,14 +83,14 @@ test('defaults to direct attestation if no attestation type is specified', () => expect(options.attestation).toEqual('none'); }); -test('should set authenticatorAttributes to authenticatorSelection if set', () => { +test('should set authenticatorSelection if specified', () => { const options = generateAttestationOptions({ serviceName: 'SimpleWebAuthn', rpID: 'not.real', challenge: 'totallyrandomvalue', userID: '1234', userName: 'usernameHere', - authenticatorAttributes: { + authenticatorSelection: { authenticatorAttachment: 'cross-platform', requireResidentKey: false, userVerification: 'preferred', diff --git a/packages/server/src/attestation/generateAttestationOptions.ts b/packages/server/src/attestation/generateAttestationOptions.ts index fbf62f4..59fc6f0 100644 --- a/packages/server/src/attestation/generateAttestationOptions.ts +++ b/packages/server/src/attestation/generateAttestationOptions.ts @@ -13,7 +13,7 @@ type Options = { attestationType?: AttestationConveyancePreference, excludedBase64CredentialIDs?: string[], suggestedTransports?: AuthenticatorTransport[], - authenticatorAttributes?: AuthenticatorSelectionCriteria, + authenticatorSelection?: AuthenticatorSelectionCriteria, }; /** @@ -32,7 +32,8 @@ type Options = { * @param excludedBase64CredentialIDs Array of base64-encoded authenticator IDs registered by the * user so the user can't register the same credential multiple times * @param suggestedTransports Suggested types of authenticators for attestation - * @param authenticatorAttributes Advanced criteria for the types of authenticators that may be used + * @param authenticatorSelection Advanced criteria for restricting the types of authenticators that + * may be used */ export default function generateAttestationOptions( options: Options, @@ -48,7 +49,7 @@ export default function generateAttestationOptions( attestationType = 'none', excludedBase64CredentialIDs = [], suggestedTransports = ['usb', 'ble', 'nfc', 'internal'], - authenticatorAttributes, + authenticatorSelection, } = options; return { @@ -75,6 +76,6 @@ export default function generateAttestationOptions( type: 'public-key', transports: suggestedTransports, })), - authenticatorSelection: authenticatorAttributes, + authenticatorSelection, }; } |