Skip to content

feat: add PasskeyAuthenticatorInterface implemented by PasskeyAuthenticator#247

Merged
spydon merged 3 commits into
corbado:mainfrom
spydon:feat/passkey-authenticator-interface
Jun 29, 2026
Merged

feat: add PasskeyAuthenticatorInterface implemented by PasskeyAuthenticator#247
spydon merged 3 commits into
corbado:mainfrom
spydon:feat/passkey-authenticator-interface

Conversation

@spydon

@spydon spydon commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a PasskeyAuthenticatorInterface to passkeys_platform_interface and makes the passkeys package's PasskeyAuthenticator implement it.

// passkeys_platform_interface/lib/passkey_authenticator_interface.dart
abstract interface class PasskeyAuthenticatorInterface {
  Future<RegisterResponseType> register(RegisterRequestType request);
  Future<AuthenticateResponseType> authenticate(AuthenticateRequestType request);
}
// passkeys/lib/authenticator.dart
class PasskeyAuthenticator implements PasskeyAuthenticatorInterface { ... }

The interface is re-exported from passkeys_platform_interface.dart.

Why

Packages that integrate passkeys (for example Supabase's supabase_flutter) often only need to hand a RegisterRequestType/AuthenticateRequestType to an authenticator and read back the response. To do that today they must depend on the full passkeys plugin, which forces every consumer of their package to raise minimum platform versions (iOS 16.0 / macOS 13.5) and pull in the plugin's transitive dependencies, even when passkeys are never used.

With this interface, such a package can depend only on passkeys_platform_interface and accept a PasskeyAuthenticatorInterface. Apps that want passkeys add the passkeys plugin themselves and pass their PasskeyAuthenticator straight in; apps that do not are unaffected.

Non-breaking

PasskeyAuthenticator.register and .authenticate already have exactly the signatures the interface declares, so implements only adds a supertype. No method, behavior, or public-API changes.

Notes

  • Versions, CHANGELOGs, and the intra-workspace passkeys_platform_interface constraint bump are left to the Melos release tooling.
  • flutter analyze passes for both packages (the implements clause resolves cleanly, confirming the class satisfies the interface). The only analyzer output is pre-existing info-level lints in unrelated files.

Happy to adjust naming, file location, or whether the interface should also be re-exported from passkeys/types.dart to match your preferences.

…icator

Add a `PasskeyAuthenticatorInterface` to `passkeys_platform_interface`
declaring the `register` and `authenticate` ceremony methods, and have the
`passkeys` package's `PasskeyAuthenticator` implement it.

This lets packages accept an authenticator while depending only on
`passkeys_platform_interface`, without taking on the full `passkeys` plugin and
its platform requirements. The interface signatures match the existing
`PasskeyAuthenticator` methods, so implementing it is non-breaking.
@spydon spydon merged commit bcc028f into corbado:main Jun 29, 2026
0 of 2 checks passed
spydon added a commit to supabase/supabase-flutter that referenced this pull request Jun 29, 2026
…f depending on passkeys (#1444)

## What

Removes the direct dependency on the
[`passkeys`](https://pub.dev/packages/passkeys) plugin.
`supabase_flutter` now depends only on
[`passkeys_platform_interface`](https://pub.dev/packages/passkeys_platform_interface)
and the experimental passkey methods accept a
`PasskeyAuthenticatorInterface`:

```dart
import 'package:passkeys/authenticator.dart';

final authenticator = PasskeyAuthenticator();

await supabase.auth.signInWithPasskey(authenticator);
await supabase.auth.registerPasskey(authenticator);
```

## Why

`supabase_flutter` only needs the WebAuthn request/response types and
the two ceremony methods. Bundling the full `passkeys` plugin forced
**every** app, even ones that never touch passkeys, to raise minimum
platform versions to iOS 16.0 / macOS 13.5 and pull in transitive deps
(`passkeys_doctor` → `device_info_plus`). Depending on the platform
interface and accepting an authenticator instance removes that.

## How

- `pubspec.yaml`: `passkeys` → `passkeys_platform_interface: ^2.7.0`.
- `registerPasskey` / `signInWithPasskey` take a
`PasskeyAuthenticatorInterface`. Both are `@experimental`, so no major
version bump.
- `passkey_options_mapper.dart`: imports types from
`passkeys_platform_interface`.
- Removed the now-unnecessary `device_info_plus` `dependency_overrides`
in the example (verified the example no longer pulls
`passkeys`/`device_info_plus` when the local package is linked).
- Updated the README passkeys section, including the `passkeys >=2.21.0`
floor consumers need for `PasskeyAuthenticator` to implement the
interface.

## Upstream dependency (now published)

This builds on **corbado/flutter-passkeys#247**, which adds
`PasskeyAuthenticatorInterface` to `passkeys_platform_interface` and
makes `passkeys`'s `PasskeyAuthenticator` implement it. Both changes are
non-breaking for those packages (the method signatures already match
exactly, so `implements` only adds a supertype).

That PR is merged and the packages are published:
- `passkeys_platform_interface` **2.7.0** carries the interface (pinned
here).
- `passkeys` **2.21.0** is the first release whose
`PasskeyAuthenticator` implements it; that is the documented floor for
consumers.

## Verification

- `flutter pub get` resolves `passkeys_platform_interface` to the
published `2.7.0`.
- `flutter analyze` clean on the changed sources.
- Mapper and package tests pass.
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

Successfully merging this pull request may close these issues.

1 participant