Skip to content

feat(aws): add native SSM discovery and sessions with web sign-in - #344

Merged
shihuili1218 merged 6 commits into
mainfrom
feat/aws-native-ssm
Nov 18, 2026
Merged

shihuili1218 merged 6 commits into
mainfrom
feat/aws-native-ssm

Conversation

@shihuili1218

@shihuili1218 shihuili1218 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Add AWS SSM (Native) alongside the existing AWS SSM (CLI) provider. Users sign in on the AWS website, paste the authorization response, and enter the Region to query. EC2 discovery and Session Manager shells run in Rust without AWS CLI or session-manager-plugin; the existing CLI provider and saved configurations remain supported.

Authorization stays in backend memory until the discovery source is saved. Save commits through SecretStore; cancel preserves the previous saved grant. Login uses PKCE, DPoP and STS identity verification, with serialized credential refresh and owner-bound drafts. Concurrent source edits are checked before deleting credentials, and failed saves restore previous grants. The form uses one shared form-error display.

Native SSM uses the session lifecycle registry, signed WebSockets, ordered/acknowledged frames, bounded retransmission, ResumeSession, remote cleanup and optional KMS encryption, including the Agent's challenge context. Continuous output no longer starves terminal input. Discovery results remain transient launch targets. Disabling or removing a discovery source clears its cached targets without closing existing tabs. AWS sign-out and source removal clear the saved grant; an already connected shell can keep using its open channel. New connections and automatic resumes require valid credentials.

SSM cleanup skips redundant termination after a session-bound remote close notification. API failures count as successful cleanup only for an explicit missing session or matching terminated history. An owner-scoped, read-only status command clears stale notices after backend recovery; unresolved notices can be collapsed while retaining retry controls and now use connection names.

Entry points:

  • Desktop GUI: browser sign-in, source management, EC2 discovery and native terminal sessions; original AWS CLI flow retained.
  • Mobile GUI: native discovery and SSM do not depend on local PTY/CLI availability. Region/sign-in controls remain usable in compact layouts and with touch or hardware input.
  • CLI: rssh aws supports source CRUD, login/logout/status and discovery. Native interactive SSM shell and SFTP/file download are not included.
  • Headless / JetBrains: the same frontend and core implementation are exposed through matching commands, owner checks and localized errors.

Validation:

  • npm test: 127 files, 1,467 tests passed.
  • npm run build: passed; existing accessibility/CSS/chunk-size warnings remain.
  • cargo test --workspace --all-features --locked: 1,087 tests passed; one doc test ignored.
  • cargo fmt --all --check, git diff --check: passed.
  • cargo check -p rssh-app --features tauri,server --bins --locked and cargo check -p rssh-cli --locked: passed.
  • Local mock HTTP/WebSocket coverage includes login/refresh, draft cancellation and rollback, concurrent source changes, pagination, KMS, retransmission, reconnect, lifecycle cleanup and input fairness.
  • A browser UI fixture verified cleanup notice collapse/reopen and automatic removal after backend confirmation without AWS access.
  • Development GUI launched; the final headless build was clicked through to verify both AWS types, Region validation, a single error display and cancellation without saving.

AWS browser sign-in was confirmed by the user during development. A live EC2-to-native-SSM end-to-end run and physical mobile-device testing remain unverified. IAM Identity Center SSO is intentionally outside this change; native WebSocket HTTP CONNECT proxy support is not included.

Copilot AI balanced review requested due to automatic review settings November 17, 2026 06:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T05:46:35.690734Z 9d75fd0 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ec9df672c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cli/src/commands/aws.rs
}
AwsCmd::Logout { id } => {
find_source(&sources, &id)?;
auth.logout(&id).await

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Coordinate CLI logout with the host's active SSM sessions

When a native SSM session is open in the GUI or headless host, CLI logout deletes its persisted refresh grant without closing that host's session. Unlike commands::aws_signin::aws_signin_logout, this path never calls close_source_sessions. If the session remains open until its temporary credentials expire, subsequent cleanup cannot refresh credentials, and AwsService::terminate can only fall back to the expired cached credentials; closing the tab then leaves remote termination failing on every retry. Coordinate logout with the owning host before deleting the grant, using the existing local IPC channel; CLI source removal needs the same protection.

AGENTS.md reference: AGENTS.md:L24-L26

Useful? React with 👍 / 👎.

@shihuili1218
shihuili1218 merged commit 806a455 into main Nov 18, 2026
2 checks passed
@shihuili1218
shihuili1218 deleted the feat/aws-native-ssm branch November 18, 2026 05:54
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