Repository navigation
UTS: assert authorize() supersedes stored authOptions (key not preserved) - #541
Open
owenpearson wants to merge 2 commits into
Open
owenpearson wants to merge 2 commits into
owenpearson wants to merge 2 commits into
Conversation
owenpearson
added a commit
that referenced
this pull request
Nov 27, 2026
Test IDs are copied into derived tests in several SDKs, so a rename has a downstream cost. Keep the renames where the old id names a different requirement, and revert those where the old id is coarse but not wrong: the type-level ids TD1, TK1 and TE1, and the parent-family ids TI and RSL1k. Their section headings keep the more specific spec point. File the authOptions test under RSA10e rather than RSA10j. It asserts that an authCallback in the authOptions argument is used to obtain the token, which is RSA10e's text, and it avoids a second RSA10j/...-0 id once #541 lands. RSA10j is no longer tested in this file, so it leaves the spec points list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
With the preserves-key test moved to RSA10j, the error-propagation test is the only RSA10i test in the file, so it takes index 0. RSA10j joins the file's spec points and the completion matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
owenpearson
force-pushed
the
fix/uts-authorize-key-superseded
branch
from
November 27, 2026 13:38
e258fd1 to
e5bb584
Compare
owenpearson
changed the base branch from
main
to
fix/uts-spec-point-references
November 27, 2026 13:38
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.Test ID renumbering
With the preserves-key test moved to RSA10j, the error-propagation test that #539 files as
rest/unit/RSA10i/authorize-error-propagated-1is the only RSA10i test left in the file. This PR renumbers it torest/unit/RSA10i/authorize-error-propagated-0, and adds RSA10j to the file's spec points and to the RSA10 row ofuts/docs/completion-status.md.Old to new, for SDK repos (on top of #539's table):
rest/unit/RSA10i/authorize-preserves-key-0rest/unit/RSA10j/authorize-supersedes-authoptions-key-0rest/unit/RSA10i/authorize-error-propagated-1(from #539)rest/unit/RSA10i/authorize-error-propagated-0Merge order
Stacked on #539: this PR's base is
fix/uts-spec-point-references. Merge #539 first; GitHub then retargets this PR tomain. It also sharesuts/rest/unit/auth/authorize.mdwith #534, so rebase after that merges if it conflicts.🤖 Generated with Claude Code