UTS: assert authorize() supersedes stored authOptions (key not preserved) - #541
Open
owenpearson wants to merge 1 commit into
Open
owenpearson wants to merge 1 commit into
owenpearson wants to merge 1 commit into
Conversation
Per RSA8e/RSA10j a provided AuthOptions replaces the stored options wholesale, so a constructor key does not survive an authOptions argument that omits one. Replaces the empty (comment-only) assertions block with concrete assertions that a subsequent key-requiring operation fails with 40101, and retitles the mislabelled RSA10i section. Closes #531 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This branch was successfully deployed
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.
Ruling
Closes #531. Rules in favour of Reading 2 — the key is superseded. Per the plain reading of
RSA8eandRSA10j, passing anAuthOptionsargument toauthorize()supersedes the storedAuthOptionsin their entirety (AuthOptions#keyincluded), so a key configured on the constructor is discarded when the argument omits one. This is what both ably-python and ably-js already do, so nofeatures.mdchange and no SDK change are required.What the section used to claim vs what it now asserts
The section
RSA10i - authorize() preserves key from constructor(rest/unit/RSA10i/authorize-preserves-key-0) asserted, in prose, that the constructor key is preserved across anauthOptionsargument — a behaviourfeatures.mddoes not state (features.md:262RSA10i is merely a pointer into RSA8, not a preservation rule). Its assertions block was three comments with noASSERT, i.e. silently zero coverage.It is now retitled
RSA10j - authorize() authOptions argument supersedes stored key, with Test IDrest/unit/RSA10j/authorize-supersedes-authoptions-key-0, and asserts the specified superseding behaviour: afterauthorize(authOptions: AuthOptions(authUrl: ...))with no key, the constructor key is gone; a furtherauthorize(authOptions: AuthOptions())— leaving no key, authUrl or authCallback — fails with40101/ statusCode401("No key specified"), as raised by ably-js in this situation.Merge order
This branch shares
uts/rest/unit/auth/authorize.mdwith the mock-HTTP PR #534 and the spec-point-references PR #539. Rebase this branch after those merge.🤖 Generated with Claude Code