Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions docs/cmd/integration-bitbucket-allowlist-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Change which repositories of a linked Bitbucket workspace SafeDep scans.
## Synopsis

```
safedep integration bitbucket allowlist update [--link-id LINK_ID]
safedep integration bitbucket allowlist update [--account WORKSPACE]
[--scope all|selected]
[--enable REPOSITORY_UUID]...
[--disable REPOSITORY_UUID]...
Expand All @@ -24,7 +24,7 @@ opens the scope or fills the allowlist.

| Flag | Description |
|------|-------------|
| `--link-id <id>` | Bitbucket workspace link to update. Resolved automatically when the tenant has exactly one link. |
| `--account <workspace>` | Slug of the linked Bitbucket workspace to update, for example `safedep`. Matched without regard to case. Needed when the tenant has more than one linked workspace. |
| `--scope <all\|selected>` | Scan scope after the update. Omit to keep the stored scope. Switching scope does not change the stored allowlist. |
| `--enable <uuid>` | Repository UUID to add to the allowlist. Braced and uppercase forms are accepted and normalized. Repeat for multiple repositories. A UUID already on the allowlist is a no-op. |
| `--disable <uuid>` | Repository UUID to remove from the allowlist. Braced and uppercase forms are accepted and normalized. Repeat for multiple repositories. A UUID not on the allowlist is a no-op. |
Expand All @@ -34,12 +34,16 @@ takes no `--enable` or `--disable` values. At most 500 UUIDs per flag per
request: a larger allowlist grows over several calls. Get repository UUIDs
from `safedep integration bitbucket repository list`.

`--link-id <id>` still selects a link by its internal ID. It is hidden from
the help and stays for scripts. With `--link-id` alone, the command lists no
links. With `--link-id` and `--account`, both must name the same link.

## Examples

Scan every repository in the workspace:

```bash
safedep integration bitbucket allowlist update --scope all
safedep integration bitbucket allowlist update --account safedep --scope all
```

Scan two selected repositories only:
Expand All @@ -62,9 +66,13 @@ safedep integration bitbucket allowlist update \
| Field | Description |
|-------|-------------|
| `link_id` | The workspace link the update ran against, supplied or resolved. |
| `account` | The workspace slug of that link. Omitted when only `--link-id` named the link. In `plain` output, the last column, with `-` for no slug. |
| `scan_scope` | The scan scope after the update. |
| `allowlisted_repository_count` | The number of repositories on the allowlist after the update. |

`table` shows the account in place of the link ID, or `link <id>` when only
`--link-id` named the link.

## Authentication

Requires a control-plane OAuth session with the tenant admin role. Run
Expand Down
22 changes: 13 additions & 9 deletions docs/cmd/integration-bitbucket-link-delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@ Unlink a Bitbucket workspace from the active SafeDep tenant.
## Synopsis

```
safedep integration bitbucket link delete [--link-id <id>]
safedep integration bitbucket link delete [--account WORKSPACE]
```

## Description

SafeDep revokes the workspace link and discards the stored app token. After
the unlink, SafeDep no longer scans the workspace's repositories.

With `--link-id`, the command is idempotent: deleting a link that is already
revoked succeeds. Without `--link-id`, the command resolves the tenant's only
active link. After that link is deleted, a repeat call without `--link-id`
finds no link and fails with not found.
`--account` names the workspace by its slug. Without it, the command resolves
the tenant's only active link. The command picks from active links only, so a
repeat call after the delete fails with not found.

`--link-id <id>` still selects a link by its internal ID. It is hidden from
the help and stays for scripts. With `--link-id` alone, the command lists no
links and is idempotent: deleting a link that is already revoked succeeds.
With `--link-id` and `--account`, both must name the same active link.

The SafeDep Forge app stays installed in the workspace. It keeps sending
events, and SafeDep ignores them. Only a Bitbucket workspace admin can
Expand All @@ -30,7 +34,7 @@ workspace's SafeDep settings page. No reinstall is needed.

| Flag | Description |
|------|-------------|
| `--link-id` | The workspace link to delete. When the tenant has exactly one link, the command resolves it automatically. Find link IDs with `safedep integration bitbucket link list`. |
| `--account <workspace>` | Slug of the linked Bitbucket workspace to unlink, for example `safedep`. Matched without regard to case. Needed when the tenant has more than one linked workspace. Find slugs with `safedep integration bitbucket link list`. |

## Examples

Expand All @@ -39,7 +43,7 @@ safedep integration bitbucket link delete
```

```bash
safedep integration bitbucket link delete --link-id 01J8X2...
safedep integration bitbucket link delete --account safedep
```

## Authentication
Expand All @@ -51,5 +55,5 @@ Requires a control-plane OAuth session with the admin role. Run

| Code | Meaning |
|------|---------|
| `0` | The link is revoked. With `--link-id`, this includes a link revoked before this call. |
| non-zero | Authentication failed, the tenant has no link or more than one link without `--link-id`, the link does not belong to the tenant, or the request failed. |
| `0` | The link is revoked. With `--link-id` alone, this includes a link revoked before this call. |
| non-zero | Authentication failed, the tenant has no link, more than one link without `--account`, or no active link for the account, the link does not belong to the tenant, or the request failed. |
12 changes: 7 additions & 5 deletions docs/cmd/integration-bitbucket-link-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ safedep integration bitbucket link list [--output table|plain|json]

## Description

Each row is one linked workspace with its link ID. The link ID feeds
`safedep integration bitbucket repository list` and
`safedep integration bitbucket allowlist update`. The command walks every
page of the listing.
Each row is one linked workspace with its link ID and slug. The slug is the
`--account` value of `safedep integration bitbucket repository list`,
`safedep integration bitbucket allowlist update`,
`safedep integration bitbucket link delete` and `safedep project sync`. The
link ID is for scripts that pass the hidden `--link-id` flag. The command walks
every page of the listing.

## Examples

Expand All @@ -31,7 +33,7 @@ safedep integration bitbucket link list --output json | jq -r '.links[].link_id'
|-------|-------------|
| `link_id` | The tenant-owned workspace link ID. |
| `workspace_uuid` | The immutable Bitbucket workspace UUID: lowercase, hyphenated, no braces. |
| `workspace_slug` | The workspace slug at the last sync. Mutable metadata, not identity. |
| `workspace_slug` | The workspace slug at the last sync, and the `--account` value of the other commands. Mutable metadata, not identity. |
| `workspace_name` | The workspace display name at the last sync. Mutable metadata. |

## Authentication
Expand Down
17 changes: 11 additions & 6 deletions docs/cmd/integration-bitbucket-repository-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,26 @@ List the repositories of a linked Bitbucket workspace with their scan state.
## Synopsis

```
safedep integration bitbucket repository list [--link-id LINK_ID]
safedep integration bitbucket repository list [--account WORKSPACE]
[--output table|plain|json]
```

## Flags

| Flag | Description |
|------|-------------|
| `--link-id <id>` | Bitbucket workspace link to list through. Resolved automatically when the tenant has exactly one link. |
| `--account <workspace>` | Slug of the linked Bitbucket workspace to list, for example `safedep`. Matched without regard to case. Needed when the tenant has more than one linked workspace. |

Inherits root flags `--output` and `--profile`.

When `--link-id` is omitted, the CLI lists the tenant's workspace links and
When `--account` is omitted, the CLI lists the tenant's workspace links and
uses the only one it finds. With no link, the command fails and points to
`link create`. With more than one link, it fails and lists the link IDs and
workspace slugs so you can pick one.
`link create`. With more than one link, it fails and lists the workspace
slugs so you can pick one with `--account`.

`--link-id <id>` still selects a link by its internal ID. It is hidden from
the help and stays for scripts. With `--link-id` alone, the command lists no
links. With `--link-id` and `--account`, both must name the same link.

## Examples

Expand All @@ -29,7 +33,7 @@ safedep integration bitbucket repository list
```

```bash
safedep integration bitbucket repository list --link-id 01K88WX3G9RGAK8T3N5YJMFQN1 \
safedep integration bitbucket repository list --account safedep \
--output json | jq -r '.repositories[] | select(.scan_state == "disabled") | .repository_uuid'
```

Expand All @@ -38,6 +42,7 @@ safedep integration bitbucket repository list --link-id 01K88WX3G9RGAK8T3N5YJMFQ
| Field | Description |
|-------|-------------|
| `link_id` | The workspace link the listing ran through, supplied or resolved. |
| `account` | The workspace slug of that link. Omitted when only `--link-id` named the link. |
| `scan_scope` | The workspace's scan scope: `all` or `selected`. |
| `repository_uuid` | The immutable Bitbucket repository UUID. Feed it to `allowlist update`. |
| `full_name` | The `workspace/repository` name. |
Expand Down
Loading
Loading