Skip to content

Commit 43c0ee9

Browse files
feat: confluence improvements (#348)
- Remove token-type flag: accept both token formats; use only --token. - Improve error handling with clearer, typed errors. - Add consolidated warning message for invalid page IDs, space IDs and space keys. - Add limits for page body size, api response size, total fetched data to scan
1 parent 10bef08 commit 43c0ee9

File tree

6 files changed

+1858
-597
lines changed

6 files changed

+1858
-597
lines changed

README.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -153,53 +153,49 @@ Provide tokens and other secrets through environment variables (`-e SLACK_TOKEN=
153153

154154
```bash
155155
2ms confluence https://<org>.atlassian.net/wiki --space-keys ENG,SEC --history \
156-
--username [email protected] --token-type api-token --token-value "$ATLASSIAN_TOKEN"
156+
--username [email protected] --token "$ATLASSIAN_TOKEN"
157157
```
158158

159-
| Flag | Type | Description |
160-
|------|------|-------------|
161-
| `--space-keys` | string slice | Comma-separated space keys to crawl. |
162-
| `--space-ids` | string slice | Comma-separated space IDs to crawl. |
163-
| `--page-ids` | string slice | Specific page IDs to scan. |
164-
| `--history` | bool | Include all revisions (page history). |
165-
| `--username` | string | Confluence user/email for authentication. |
166-
| `--token-type` | string | `api-token` or `scoped-api-token`. Required when `--token-value` is set. |
167-
| `--token-value` | string | Token value used with `--token-type`. |
159+
| Flag | Type | Description |
160+
|------|------|---------------------------------------------------------|
161+
| `--space-keys` | string slice | Comma-separated space keys to crawl. |
162+
| `--space-ids` | string slice | Comma-separated space IDs to crawl. |
163+
| `--page-ids` | string slice | Specific page IDs to scan. |
164+
| `--history` | bool | Include all revisions (page history). |
165+
| `--username` | string | Confluence user/email for authentication. |
166+
| `--token` | string | Authentication token (Confluence API token or scoped API token). |
167+
| `--max-api-response-megabytes` | int | Soft per-response size limit (MB). `0` disables it. Exceeded batches are skipped. |
168+
| `--max-page-body-megabytes` | int | Soft per-page body size limit (MB). `0` disables it. Oversized pages are skipped. |
169+
| `--max-total-scan-megabytes` | int | Global download limit (MB). `0` disables it. If exceeded, the scan stops early. |
168170

169171
URLs must be HTTPS. Without credentials 2ms scans only public content.
170172

171173
#### Authentication
172-
- To scan **private spaces**, provide `--username`, `--token-type` and `--token-value` (API token).
174+
- To scan **private spaces**, provide `--username` and `--token` (API token).
173175
- How to create a Confluence API token: https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/
174176

175177
#### Examples
176178

177179
- Scan **all public pages** (no auth):
178180
```bash
179-
2ms confluence https://<company id>.atlassian.net/wiki
180-
```
181-
182-
- Scan **private pages with an api token** (requires auth):
183-
```bash
184-
2ms confluence https://<company id>.atlassian.net/wiki --username <USERNAME> --token-type api-token --token-value <API_TOKEN>
181+
2ms confluence https://<org>.atlassian.net/wiki
185182
```
186183

187-
- Scan **private pages with a scoped api token** (requires auth):
184+
- Scan **private pages with an api token or a scoped api token** (requires auth):
188185
```bash
189-
2ms confluence https://<company id>.atlassian.net/wiki --username <USERNAME> --token-type scoped-api-token --token-value <API_TOKEN>
186+
2ms confluence https://<org>.atlassian.net/wiki --username <USERNAME> --token <API_TOKEN>
190187
```
191188

192189
- Scan specific **spaces by ID**:
193190
```bash
194-
2ms confluence https://<company id>.atlassian.net/wiki --space-ids 1234567890,9876543210
191+
2ms confluence https://<org>.atlassian.net/wiki --space-ids 1234567890,9876543210
195192
```
196193

197194
- Scan specific **pages by ID**:
198195
```bash
199-
2ms confluence https://<company id>.atlassian.net/wiki --page-ids 11223344556,99887766554
196+
2ms confluence https://<org>.atlassian.net/wiki --page-ids 11223344556,99887766554
200197
```
201198

202-
203199
### Slack
204200

205201
```bash

0 commit comments

Comments
 (0)