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

Instance based API timeline #367

Closed
Brantron opened this issue Aug 30, 2022 · 8 comments
Closed

Instance based API timeline #367

Brantron opened this issue Aug 30, 2022 · 8 comments

Comments

@Brantron
Copy link

Brantron commented Aug 30, 2022

Hello! Awesome work on this gem, I'm excited to start using it.

One question I have is around Instance based configuration.

DISCLAIMER: This API was released on version 3.0.0.alpha1 and is still under evaluation. Although it has been throughly tested and it is fully functional it might be changed until the final release of version 3.0.0.

Any timeline on when 3.0.0 will be released?

@Brantron
Copy link
Author

For a little more context, I would like to use that release, but the diff against the latest version release is fairly substantial v3.0.0.alpha1...v2.5.2 so it feels like getting a path to support this going forward would be really helpful.

@anero
Copy link

anero commented Sep 1, 2022

It's also not possible to use the 3.0.0.alpha1 version with OpenSSL 3.0

@Brantron
Copy link
Author

Brantron commented Sep 2, 2022

For folks that are interested, I think I may have a working solution, although I'm still thinking it out. Here's the pseudocode

class WebauthnClient
  CONFIGURATION_MUTEX = Mutex.new
  
  # synchronize configuration, ensuring the block given has the correct context
  def with_configuration(&_blk)
    CONFIGURATION_MUTEX.synchronize do
      WebAuthn.configure do |config|
        config.origin = context_specific_domain_name
        config.rp_name = context_specific_site_name
      end
      yield
    end
  end
  
  def options_for_registration(webauthn_id:, name:, exclude_credentials: [])
    with_configuration do
      WebAuthn::Credential.options_for_create(
        user: { id: webauthn_id, name: name },
        exclude: exclude_credentials,
      )
    end
  end
end

@bdewater
Copy link
Collaborator

bdewater commented Sep 6, 2022

https://github.com/cedarcode/webauthn-ruby/network shows the 3-dev branch is fairly old, and so is the v3.0.0.alpha1 tag.

I can get started on a v3.0.0.alpha2 that's on master with the changes for the instance based config, now that there's a 2-stable branch for maintaining the current version.

@bdewater bdewater mentioned this issue Sep 8, 2022
@bdewater
Copy link
Collaborator

bdewater commented Sep 8, 2022

Getting #368 to work wasn't very hard - some merge conflicts and a few array-indexed tests that needed updating. Please give it a try and report any findings (good or bad) there 🙏

@Brantron
Copy link
Author

Brantron commented Sep 9, 2022

What's not clear to me is why was this reverted in the last attempt?

@brauliomartinezlm
Copy link
Member

I have answered in the PR itself. Just an extra thank you @Brantron for getting the conversation started on this and @bdewater for actioning quickly on this! We'll get this sorted out shortly and stop having forked versions and documentation of the API soon.

@brauliomartinezlm
Copy link
Member

Closing as we've just released v3.0.0.alpha2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants