Skip to content

feat: enforce team membership validation for cloudtty access - #1075

Open
CasLubbers wants to merge 1 commit into
mainfrom
APL-2105
Open

feat: enforce team membership validation for cloudtty access#1075
CasLubbers wants to merge 1 commit into
mainfrom
APL-2105

Conversation

@CasLubbers

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI lite review requested due to automatic review settings August 27, 2026 11:55
@CasLubbers CasLubbers changed the title feat: feat: enforce team membership validation for cloudtty access feat: enforce team membership validation for cloudtty access Aug 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens CloudTTY access control by ensuring users can only open/delete a cloud shell for teams they belong to, and aligns the CloudTTY OpenAPI ACL to avoid cross-team access for team admins.

Changes:

  • Enforce team membership checks in OtomiStack.connectCloudtty() and OtomiStack.deleteCloudtty() for non-platform-admin users.
  • Update Cloudtty OpenAPI ACL so teamAdmin actions are team-scoped (create/read/update/delete vs *-any).
  • Add authz tests to ensure team admins cannot connect/delete CloudTTY for another team.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/otomi-stack.ts Adds explicit membership enforcement before connecting/deleting CloudTTY for non-platform admins.
src/openapi/cloudtty.yaml Makes teamAdmin permissions team-scoped to prevent cross-team access via *-any.
src/api-v2.authz.test.ts Expands authz coverage for team-admin CloudTTY access restrictions.
Suppressed comments (1)

src/api-v2.authz.test.ts:1864

  • Team-admin DELETE /v2/cloudtty is only tested for the cross-team 403 case. Add a positive test for deleting cloudtty for the admin’s own team to ensure the new membership validation doesn’t block legitimate deletes.
        await agent
          .delete('/v2/cloudtty')
          .query({ teamId: 'team2' })
          .set('Authorization', `Bearer ${teamAdminToken}`)
          .expect(403)

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/api-v2.authz.test.ts
Comment on lines 1839 to 1840
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants