Skip to content

feat: s2s admin claim#1360

Merged
ravverma merged 4 commits intomainfrom
s2sadmin-profile-claim
Feb 18, 2026
Merged

feat: s2s admin claim#1360
ravverma merged 4 commits intomainfrom
s2sadmin-profile-claim

Conversation

@ravverma
Copy link
Contributor

Summary

Branch: s2sadmin-profile-claim
Commit: d9a62e32feat: s2s admin claim

Changes

packages/spacecat-shared-http-utils/src/auth/auth-info.js

  • Added isS2SAdmin() method to the AuthInfo class that returns the is_s2s_admin claim from the user profile (using optional chaining for safety).

packages/spacecat-shared-http-utils/test/auth/auth-info.test.js

  • Added 4 unit tests for isS2SAdmin():
    • Returns undefined when no profile is set
    • Returns undefined when is_s2s_admin is not present in the profile
    • Returns true when is_s2s_admin is true
    • Returns false when is_s2s_admin is false

Test Results

  • All 124 tests passing
  • 100% code coverage on auth-info.js

@ravverma ravverma requested a review from solaris007 February 17, 2026 12:55
@github-actions
Copy link

This PR will trigger a minor release when merged.

@solaris007 solaris007 added the enhancement New feature or request label Feb 18, 2026
@solaris007
Copy link
Member

solaris007 commented Feb 18, 2026

@ravverma

Reviewed together with the related spacecat-auth-service#448 (sets the is_s2s_admin claim in the JWT).

Clean, minimal change. The isS2SAdmin() accessor follows the exact same pattern as isLLMOAdministrator(). Four well-structured tests covering undefined profile, missing claim, true, and false.

No issues found. Ready to merge.

Copy link
Member

@solaris007 solaris007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Clean accessor following existing patterns, well-tested.

@ravverma ravverma merged commit 2749376 into main Feb 18, 2026
7 checks passed
@ravverma ravverma deleted the s2sadmin-profile-claim branch February 18, 2026 12:26
solaris007 pushed a commit that referenced this pull request Feb 18, 2026
@solaris007
Copy link
Member

🎉 This PR is included in version @adobe/spacecat-shared-http-utils-v1.21.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments