feat(core)!: migrate to @icp-sdk/auth v7#896
Conversation
…etIdentity) - bump @icp-sdk/auth peer to ^7 across core, core-peer, core-standalone - AuthClient.create() -> new AuthClient(); provider options (identityProvider, windowOpenerFeatures, derivationOrigin, openIdProvider) now passed at construction - login() -> signIn() (throws); logout() -> signOut() - getIdentity() is now async -> getAnyIdentity + downstream datastore/storage/functions call sites awaited; downloadUrl stays sync (satelliteUrl ignores identity) - drop allowPinAuthentication and ERROR_USER_INTERRUPT (removed upstream) Source typechecks against v7. Test mocks updated separately.
…d sessions - update all auth/worker specs to the v7 API (constructor, signIn/signOut, async getIdentity, sync isAuthenticated); add ctorReturning mock helper - remove now-dead allowPin option + ALLOW_PIN_AUTHENTICATION constant - setAuthClientStorage now mirrors the localStorage expiration flag that v7's sync isAuthenticated() reads, so OpenID-redirect / WebAuthn injected sessions are recognised as authenticated (and logout clears it) All 324 core tests pass; typecheck, eslint and prettier clean.
|
Thanks for the PR. Is it addressing a specific issue or bug? Or is the current public API of Internet Identity about to be deprecated? If yes, can you point me to the announcement and documentation? If neither of those scenarios applies, given that Juno is in maintenance and will inevitably be deprecated in the future, I don't see any rush or reason to upgrade the |
|
@peterpeterparker , I was actually just trying to have a look at this issue #892 But maybe it was open before putting Juno in maintenance mode, I suppose. In any case, if that issue gets closed, i can close all the related PRs |
|
I see, thanks for the feedback. I don't remember if it was open before or just after Juno went into maintenance. |
First wave of the
@icp-sdk/authv7 adoption (#892).Migrates juno's auth to the v7 API:
AuthClient.create()→new AuthClient(); provider options (identityProvider,derivationOrigin,windowOpenerFeatures,openIdProvider) are passed at constructionlogin()→signIn()(throws);logout()→signOut()getIdentity()is async,isAuthenticated()is sync, with the downstream datastore/storage/functions call sites adjusted (downloadUrlstays sync)setAuthClientStoragemirrors the localStorage expiration flag that v7's syncisAuthenticated()reads, so OpenID-redirect / WebAuthn injected sessions are still recognised as authenticated (andlogoutclears it)All 324
@junobuild/coretests pass; typecheck, eslint and prettier are clean.Notes:
allowPinAuthenticationandERROR_USER_INTERRUPTare dropped because v7 removed them; the user-interrupt vs generic error distinction therefore collapses toSignInErroruntil the signer exposes a typed cancellation error.Follow-up waves: #897 (one-click
openIdProvider) and #898 (requestAttributes/ email).