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 serialize/deserialize PublicKeyCredentialCreationOptions and PublicKeyCredentialRequestOptions support with ObjectMapper #16446

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

justincranford
Copy link

@justincranford justincranford commented Jan 19, 2025

gh-16433 PublicKeyCredentialRequestOptions
gh-16434 PublicKeyCredentialCreationOptions

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 19, 2025
@justincranford justincranford force-pushed the webauthn-objectmapper-mixins branch from 738ec12 to bab5868 Compare January 20, 2025 05:50
@justincranford justincranford changed the title Add serialize/deserialize PublicKeyCredentialCreationOptions support with ObjectMapper Add serialize/deserialize PublicKeyCredentialCreationOptions and PublicKeyCredentialRequestOptions support with ObjectMapper Jan 20, 2025
@justincranford
Copy link
Author

justincranford commented Jan 20, 2025

Example PublicKeyCredentialRequestOptions generated programmatically by PublicKeyCredentialRequestOptionsGivens.java#L27 and used for ser/des test PublicKeyCredentialRequestOptionsTests #L48.

{
  "challenge" : "Wk_o7hpfefzwAAkUXwjinmhex8X3VMU8E8m7RVx-LEY",
  "timeout" : 60000,
  "rpId" : "example.com",
  "allowCredentials" : [ {
    "type" : "public-key",
    "id" : "aeUXlDY_PKiZseTJ5VA-DNJAVndUGiUE5MUxyH5N7Us",
    "transports" : [ "usb" ]
  }, {
    "type" : "public-key",
    "id" : "n5zsXx9ZWjUzoc0IHQ0TSU8rKYNW74jii0kronM1Sgg",
    "transports" : [ "nfc" ]
  }, {
    "type" : "public-key",
    "id" : "Wi8nebyqxM9X493ODiueLox0QqApeavXSu5n7H5iKMA",
    "transports" : [ "ble" ]
  }, {
    "type" : "public-key",
    "id" : "SmsHqATyRblJxdWlMOu7WZeJ9pIbULkYgjV-iD0JKMc",
    "transports" : [ "smart-card" ]
  }, {
    "type" : "public-key",
    "id" : "w3CtBpP5Es4EcB7fQTu21ZcpycHk6zDMi7XtztMgO-o",
    "transports" : [ "hybrid" ]
  }, {
    "type" : "public-key",
    "id" : "eSayj0RCGWxIqwPxjoAkTGlYnEjY0QEihdOT5Nhohog",
    "transports" : [ "internal" ]
  } ],
  "userVerification" : "preferred",
  "extensions" : {
    "credentialProtectionPolicy" : "userVerificationRequired",
    "enforceCredentialProtectionPolicy" : true,
    "minPinLength" : true
  }
}

@justincranford
Copy link
Author

justincranford commented Jan 20, 2025

Example PublicKeyCredentialCreationOptions generated programmatically by PublicKeyCredentialCreationOptionsGivens.java#L34 and used for ser/des test PublicKeyCredentialCreationOptionsTests#L48.

{
  "rp" : {
    "name" : "Example RP",
    "id" : "example.com"
  },
  "user" : {
    "id" : "rTGs13lbzk0IX29D3O8nl1rSWxMt_t-6FlkprqsJwqg",
    "name" : "name",
    "displayName" : "displayName"
  },
  "challenge" : "BNvbme9yq8IxqqYqP0OwkNlozv5y4MRijMB_gYjPO_s",
  "pubKeyCredParams" : [ {
    "type" : "public-key",
    "alg" : -8
  }, {
    "type" : "public-key",
    "alg" : -7
  }, {
    "type" : "public-key",
    "alg" : -35
  }, {
    "type" : "public-key",
    "alg" : -36
  }, {
    "type" : "public-key",
    "alg" : -257
  }, {
    "type" : "public-key",
    "alg" : -258
  }, {
    "type" : "public-key",
    "alg" : -259
  }, {
    "type" : "public-key",
    "alg" : -65535
  } ],
  "timeout" : 60000,
  "excludeCredentials" : [ {
    "type" : "public-key",
    "id" : "IY7SzqrJX_WXi9TheZTD6Q9QLnK0ET187DKb5LDPJoE",
    "transports" : [ "usb" ]
  }, {
    "type" : "public-key",
    "id" : "lnz6kUccUacWVmkj0Zie16KFu5GANxNw0lGDSUWV-UU",
    "transports" : [ "nfc" ]
  }, {
    "type" : "public-key",
    "id" : "qCIExK2NMAJm9lTwFXKEqtCozIhxGImxSFoD5hRUccM",
    "transports" : [ "ble" ]
  }, {
    "type" : "public-key",
    "id" : "VunPDtHX-tV76nGsC-8YCPa-zA17J_OSoD2jETFUVrI",
    "transports" : [ "smart-card" ]
  }, {
    "type" : "public-key",
    "id" : "C9HuDVfUIirLfeFI5BPprj3rBqtjvcBH1JJCY-S9yNg",
    "transports" : [ "hybrid" ]
  }, {
    "type" : "public-key",
    "id" : "LbMjgNtt8mbtOEmWBNksJuF_PaIGeNiG29SWROCVJ9w",
    "transports" : [ "internal" ]
  } ],
  "authenticatorSelection" : {
    "authenticatorAttachment" : "platform",
    "residentKey" : "required",
    "userVerification" : "preferred"
  },
  "attestation" : "direct",
  "extensions" : {
    "credentialProtectionPolicy" : "userVerificationRequired",
    "enforceCredentialProtectionPolicy" : true,
    "minPinLength" : true
  }
}

…icKeyCredentialRequestOptions support with ObjectMapper

spring-projectsgh-16433 PublicKeyCredentialRequestOptions
spring-projectsgh-16434 PublicKeyCredentialCreationOptions
@justincranford justincranford force-pushed the webauthn-objectmapper-mixins branch from bab5868 to 802191d Compare January 20, 2025 06:21
@justincranford
Copy link
Author

Hi @rwinch, here is a draft PR to add serialization/deserialization PublicKeyCredentialCreationOptions and PublicKeyCredentialRequestOptions support with ObjectMapper.

Would you be able to review? And help with next steps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants