feat(gl-sdk): add high-level auth API with Config, register, recover, connect#688
Open
feat(gl-sdk): add high-level auth API with Config, register, recover, connect#688
Conversation
8990533 to
75c4a4f
Compare
High-level auth API: Config type (network + optional DeveloperCert) and four free functions — register(), recover(), connect(), register_or_recover() — replacing the multi-object auth ceremony. Node gains credentials(), disconnect() with AtomicBool guard on all RPC methods, and with_signer() internal constructor. Handle::spawn() runs signers on a dedicated tokio runtime to avoid block_on deadlock. NAPI fix: Node lost Clone when AtomicBool was added. Wrap inner GlNode in Arc at the NAPI wrapper level for spawn_blocking, matching the existing NodeEventStream pattern. Includes Python and Android instrumented tests for the auth API.
75c4a4f to
5cb9e0a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
register,recover,connect,register_or_recover) that replaces the multi-object ceremony (Signer → Scheduler → register/recover → build Node) with single function callsConfigbuilder type for network selection and optionalDeveloperCertNode.credentials()/Node.disconnect()and guard all RPC methods against use-after-disconnectHandle::spawn) to avoid per-signer threads andblock_ondeadlocksMotivation
The current low-level API requires apps to manually orchestrate 4+ objects to get a working node. This is error-prone and exposes internal details (credential serialization, signer lifecycle, runtime management) that most apps don't need to
think about. The high-level API reduces the happy path to: