@glrs-dev/assume 0.7.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +17 -204
  3. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @glrs-dev/assume
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#230](https://github.com/iceglober/glrs/pull/230) [`129e479`](https://github.com/iceglober/glrs/commit/129e479bf7b8f7381458fbc02125cf52110d1166) Thanks [@iceglober](https://github.com/iceglober)! - feat(assume): rename `gsa profiles` → `gsa contexts`, unify "context" terminology
8
+
9
+ Breaking: `gsa profiles` is now `gsa contexts`. `gsa exec -p` is now `gsa exec -c` (`-p` still works as alias).
10
+
11
+ ## 0.7.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [#227](https://github.com/iceglober/glrs/pull/227) [`67a5627`](https://github.com/iceglober/glrs/commit/67a56276c8ca47a7497672fe7dfd58d78541b01c) Thanks [@iceglober](https://github.com/iceglober)! - fix(assume): suppress migration nag in shell-init wrapper + fix daemon detection on macOS
16
+
3
17
  ## 0.7.2
4
18
 
5
19
  ### Patch Changes
package/README.md CHANGED
@@ -1,221 +1,34 @@
1
- <div align="center">
1
+ # @glrs-dev/assume
2
2
 
3
- <br/>
3
+ SSO credential manager for AWS and GCP. Rust binary.
4
4
 
5
- # `@glrs-dev/assume`
5
+ Docs: **[glrs.dev/assume](https://glrs.dev/assume)**
6
6
 
7
- **Authenticate once, work all day.**<br/>
8
- Multi-cloud credential manager with per-shell context switching.
9
-
10
- [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE)
11
- [![npm version](https://img.shields.io/npm/v/@glrs-dev/assume?style=flat-square)](https://www.npmjs.com/package/@glrs-dev/assume)
12
-
13
- <br/>
14
-
15
- </div>
16
-
17
- ## Getting Started
18
-
19
- ### Install
7
+ ## Install
20
8
 
21
9
  ```bash
22
- npm i -g @glrs-dev/assume
10
+ glrs assume init
23
11
  ```
24
12
 
25
- The prebuilt binary for your platform is auto-selected via npm's `optionalDependencies`. No postinstall scripts.
26
-
27
- Two equivalent bins ship with the package: `gs-assume` and `gsa` (shorter alias). Pick one; they're identical.
28
-
29
- > [!NOTE]
30
- > Crates.io publishing (`cargo install glrs-assume`) is planned but not yet enabled. For now, `npm i -g @glrs-dev/assume` is the only install path.
13
+ Or standalone: `npm i -g @glrs-dev/assume`
31
14
 
32
- ### First-time setup
15
+ ## Usage
33
16
 
34
17
  ```bash
35
- gsa login aws # Opens browser for AWS Identity Center
36
- gsa profiles # List all available account/role pairs
37
- gsa use dev # Switch context by fuzzy match
18
+ gsa login aws # authenticate (opens browser)
19
+ gsa use aws dev # switch context (fuzzy match)
20
+ aws s3 ls # credentials served locally
21
+ gsa status # token expiry, daemon health
22
+ gsa contexts # list available contexts
38
23
  ```
39
24
 
40
- <br/>
41
-
42
- ## The Daily Loop
43
-
44
- > Login once, switch instantly, credentials follow you.
25
+ ## Agent integration
45
26
 
46
27
  ```bash
47
- gsa login aws # authenticate (once per session)
48
- gsa use dev # switch context in this shell
49
- gsa use prod # different context in another shell
50
- aws s3 ls # just works — credentials served locally
51
- gsa console # open AWS console in browser
52
- ```
53
-
54
- <br/>
55
-
56
- ## Commands
57
-
58
- | Command | What happens |
59
- |:--|:--|
60
- | `gsa login <provider>` | Interactive auth — opens browser, polls for completion |
61
- | `gsa use <pattern>` | Fuzzy-match context switch, per-shell. TUI picker if no pattern. |
62
- | `gsa profiles` | List all contexts with active marker and danger tags |
63
- | `gsa status` | Auth status, token expiry, active context, daemon health |
64
- | `gsa sync` | Re-fetch contexts from provider APIs |
65
- | `gsa exec -- <cmd>` | Run a command with injected credentials |
66
- | `gsa console` | Open provider's web console for active context |
67
- | `gsa credential-process` | AWS `credential_process` JSON output for SDK integration |
68
- | `gsa config show` | View current configuration |
69
- | `gsa config set <key> <val>` | Set a config value (dot notation) |
70
- | `gsa shell-init <shell>` | Print shell integration script (bash, zsh, fish) |
71
- | `gsa serve --install` | Install to PATH + launch agent (daemon starts on login) |
72
- | `gsa serve --uninstall` | Remove binary, symlink, and launch agent |
73
- | `gsa upgrade` | Self-update to latest release |
74
- | `gsa logout [provider]` | Clear stored credentials |
75
-
76
- <br/>
77
-
78
- ## Agent & MCP Integration
79
-
80
- Permission-gated credential access for AI agents (Claude Code, etc.).
81
-
82
- | Command | What happens |
83
- |:--|:--|
84
- | `gsa agent allow` | TUI multi-select to toggle which contexts agents can access |
85
- | `gsa agent allow --list` | Show currently approved contexts |
86
- | `gsa agent allow --clear` | Revoke all agent access |
87
- | `gsa agent exec -- <cmd>` | Run a command with auto-refreshing credentials (permission-gated) |
88
- | `gsa agent mcp` | Start MCP server for AI agent integration |
89
-
90
- **Default deny** — no context is agent-accessible unless explicitly approved via `gsa agent allow`.
91
-
92
- ### MCP server
93
-
94
- Register in your Claude Code settings:
95
-
96
- ```json
97
- {
98
- "mcpServers": {
99
- "gsa": { "command": "gsa", "args": ["agent", "mcp"] }
100
- }
101
- }
102
- ```
103
-
104
- Tools provided:
105
- - **`run_with_credentials`** — run a shell command with auto-refreshing AWS credentials
106
- - **`list_contexts`** — list contexts approved for agent access
107
-
108
- ### Wrapping other MCP servers
109
-
110
- Any MCP server that needs AWS credentials can be wrapped with `gsa agent exec`:
111
-
112
- ```json
113
- {
114
- "mcpServers": {
115
- "aws-tools": { "command": "gsa", "args": ["agent", "exec", "--", "npx", "@aws/mcp-server"] }
116
- }
117
- }
118
- ```
119
-
120
- The wrapped server inherits `AWS_CONTAINER_CREDENTIALS_FULL_URI` pointing at the daemon, so credentials auto-refresh indefinitely.
121
-
122
- <br/>
123
-
124
- ## Shell Integration
125
-
126
- `serve --install` adds this to your shell rc automatically:
127
-
128
- ```bash
129
- eval "$(gsa shell-init zsh)"
130
- ```
131
-
132
- This gives you:
133
- - **`gsa` wrapper** — `gsa use` sets context as an env var in the current shell
134
- - **Prompt segment** — shows `[aws:account/role]` in green (or red for dangerous contexts)
135
- - **Per-shell isolation** — each terminal can have a different active context
136
- - **Zero prompt delay** — reads an env var, no subprocess
137
-
138
- <br/>
139
-
140
- ## Configuration
141
-
142
- Config file: `~/.config/gs-assume/config.toml` (macOS: `~/Library/Application Support/gs-assume/config.toml`)
143
-
144
- ```toml
145
- [providers.aws]
146
- start_url = "https://myorg.awsapps.com/start"
147
- region = "us-east-1"
148
-
149
- [[providers.aws.profiles]]
150
- account_id = "111111111111"
151
- role_name = "AdministratorAccess"
152
- alias = "prod/admin"
153
- tags = ["production", "dangerous"]
154
- color = "red"
155
- confirm = true
156
- ```
157
-
158
- Team config (`gs-assume.team.toml` in repo root) merges with user config — user wins on conflicts.
159
-
160
- <br/>
161
-
162
- ## Security
163
-
164
- - Credentials encrypted at rest with **AES-256-GCM** (not plaintext like AWS CLI, granted, or Leapp)
165
- - Encryption key stored at `vault.key` with `0600` permissions
166
- - Credential daemon serves tokens over `localhost` only
167
- - All token files are `0600`
168
- - Agent access gated by `agent-allowed.json` allowlist (default deny)
169
- - All credential operations audit-logged to `~/.config/gs-assume/audit.log`
170
-
171
- <br/>
172
-
173
- ## Architecture
174
-
175
- ```
176
- src/
177
- ├── main.rs # CLI entry (clap)
178
- ├── cli/
179
- │ ├── agent.rs # Agent access: allow, exec, mcp dispatch
180
- │ ├── mcp.rs # MCP JSON-RPC 2.0 server over stdio
181
- │ ├── login.rs # Interactive auth + first-time setup
182
- │ ├── use_cmd.rs # Fuzzy context switch, per-shell env vars
183
- │ ├── status.rs # Auth status + prompt segment
184
- │ ├── profiles.rs # Context listing with danger tags
185
- │ ├── sync.rs # Re-fetch contexts from APIs
186
- │ ├── exec.rs # Run command with injected creds
187
- │ ├── serve.rs # Daemon + install/uninstall
188
- │ ├── console.rs # Open web console
189
- │ ├── config_cmd.rs # Config get/set/show
190
- │ ├── shell_init.rs # Shell integration output
191
- │ ├── credential_process.rs # AWS credential_process
192
- │ ├── logout.rs # Clear credentials
193
- │ └── upgrade.rs # Self-update
194
- ├── core/
195
- │ ├── config.rs # TOML config + team config merging
196
- │ ├── keychain.rs # AES-256-GCM encrypted storage
197
- │ ├── cache.rs # Context + active context + agent-allowed cache
198
- │ ├── daemon.rs # Daemon lifecycle, refresh loop, launchd
199
- │ ├── fuzzy.rs # nucleo fuzzy matching
200
- │ ├── rpc.rs # Unix socket RPC
201
- │ ├── audit.rs # Event logging
202
- │ ├── notify.rs # Desktop notifications
203
- │ └── update_check.rs # Version check + auto-upgrade
204
- ├── plugin/
205
- │ ├── mod.rs # Provider trait + data types
206
- │ └── registry.rs # Plugin registry + validation
207
- ├── providers/
208
- │ ├── aws/ # AWS Identity Center (SSO OIDC + STS)
209
- │ └── gcp/ # Google Cloud (stub)
210
- ├── tui/
211
- │ └── picker.rs # Interactive context picker + multi-select
212
- └── shell/
213
- ├── prompt.rs # ANSI prompt formatting
214
- └── completions.rs # Shell completions
28
+ gsa agent allow # approve contexts for agents
29
+ gsa agent mcp # start MCP server
215
30
  ```
216
31
 
217
- ---
32
+ ## License
218
33
 
219
- <div align="center">
220
- <sub>MIT License</sub>
221
- </div>
34
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glrs-dev/assume",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -51,9 +51,9 @@
51
51
  "typescript": "^5"
52
52
  },
53
53
  "optionalDependencies": {
54
- "@glrs-dev/assume-darwin-arm64": "0.7.2",
55
- "@glrs-dev/assume-darwin-x64": "0.7.2",
56
- "@glrs-dev/assume-linux-x64": "0.7.2",
57
- "@glrs-dev/assume-linux-arm64": "0.7.2"
54
+ "@glrs-dev/assume-darwin-arm64": "0.8.0",
55
+ "@glrs-dev/assume-darwin-x64": "0.8.0",
56
+ "@glrs-dev/assume-linux-x64": "0.8.0",
57
+ "@glrs-dev/assume-linux-arm64": "0.8.0"
58
58
  }
59
59
  }