@jfrog/opencode-jfrog-plugin 0.0.2 → 0.0.4
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.
- package/README.md +105 -51
- package/dist/index.js +30 -238
- package/package.json +6 -6
- package/skills/jfrog/SKILL.md +529 -0
- package/skills/jfrog/assets/.gitkeep +0 -0
- package/skills/jfrog/references/apptrust-entities.md +154 -0
- package/skills/jfrog/references/artifactory-api-gaps.md +206 -0
- package/skills/jfrog/references/artifactory-aql-syntax.md +656 -0
- package/skills/jfrog/references/artifactory-entities.md +236 -0
- package/skills/jfrog/references/artifactory-operations.md +178 -0
- package/skills/jfrog/references/catalog-entities.md +219 -0
- package/skills/jfrog/references/general-bulk-operations-and-agent-patterns.md +93 -0
- package/skills/jfrog/references/general-parallel-execution.md +131 -0
- package/skills/jfrog/references/general-use-case-hints.md +27 -0
- package/skills/jfrog/references/jfrog-brand-html-report.md +98 -0
- package/skills/jfrog/references/jfrog-cli-install-upgrade.md +30 -0
- package/skills/jfrog/references/jfrog-entity-index.md +112 -0
- package/skills/jfrog/references/jfrog-login-flow.md +132 -0
- package/skills/jfrog/references/jfrog-url-references.md +51 -0
- package/skills/jfrog/references/onemodel-common-patterns.md +323 -0
- package/skills/jfrog/references/onemodel-graphql.md +446 -0
- package/skills/jfrog/references/onemodel-query-examples.md +753 -0
- package/skills/jfrog/references/platform-access-entities.md +200 -0
- package/skills/jfrog/references/platform-admin-api-gaps.md +164 -0
- package/skills/jfrog/references/platform-admin-operations.md +58 -0
- package/skills/jfrog/references/projects-api.md +241 -0
- package/skills/jfrog/references/release-lifecycle-entities.md +180 -0
- package/skills/jfrog/references/stored-packages-entities.md +165 -0
- package/skills/jfrog/references/xray-entities.md +740 -0
- package/skills/jfrog/scripts/check-environment.sh +224 -0
- package/skills/jfrog/scripts/jfrog-login-register-session.sh +84 -0
- package/skills/jfrog/scripts/jfrog-login-save-credentials.sh +128 -0
- package/skills/jfrog-package-safety-and-download/SKILL.md +275 -0
- package/sync-skills-vendor.json +5 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# Platform / Access entities
|
|
2
|
+
|
|
3
|
+
When to read this file:
|
|
4
|
+
|
|
5
|
+
- Explaining how **Projects**, **repositories**, **members**, **roles**, and
|
|
6
|
+
**environments** fit together.
|
|
7
|
+
- Working with **users**, **groups**, or **access tokens** at the platform level.
|
|
8
|
+
- Building **inventories or reports** that join Artifactory data with
|
|
9
|
+
Access / Projects.
|
|
10
|
+
- Avoiding two common mistakes: inferring project membership from
|
|
11
|
+
**repository name**, or assuming **roles** are identical across projects.
|
|
12
|
+
|
|
13
|
+
For endpoint-level curl examples, see `projects-api.md`. For list-vs-detail
|
|
14
|
+
API patterns and batching, see `general-bulk-operations-and-agent-patterns.md`.
|
|
15
|
+
|
|
16
|
+
## Entity relationship overview
|
|
17
|
+
|
|
18
|
+
```mermaid
|
|
19
|
+
erDiagram
|
|
20
|
+
Project ||--o{ Repository : "projectKey"
|
|
21
|
+
Project ||--o{ ProjectRole : defines
|
|
22
|
+
Project ||--o{ ProjectMember : has
|
|
23
|
+
ProjectMember }o--|| Principal : "user or group"
|
|
24
|
+
ProjectRole }o--o{ Environment : "environments array"
|
|
25
|
+
Repository }o--o{ Environment : "repo env assignment"
|
|
26
|
+
User ||--o{ AccessToken : "creates"
|
|
27
|
+
User }o--o{ Group : "belongs to"
|
|
28
|
+
Permission }o--o{ Repository : "targets"
|
|
29
|
+
Permission }o--o{ Principal : "grants actions to"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Project
|
|
33
|
+
|
|
34
|
+
Organizational container for grouping members, roles, and resources.
|
|
35
|
+
|
|
36
|
+
| Field | Description |
|
|
37
|
+
|-------|-------------|
|
|
38
|
+
| `project_key` | Unique identifier (short string, used in APIs and repo assignment) |
|
|
39
|
+
| `display_name` | Human-readable name |
|
|
40
|
+
| `description` | Project description |
|
|
41
|
+
| `admin_privileges` | Flags controlling project-level admin behavior |
|
|
42
|
+
| `storage_quota` | Storage limits for the project |
|
|
43
|
+
|
|
44
|
+
A project hosts **members** (users and groups with roles) and **resources**
|
|
45
|
+
(repositories, builds, Release Bundles) assigned to it.
|
|
46
|
+
|
|
47
|
+
API: `GET /access/api/v1/projects`, `GET /access/api/v1/projects/<project-key>`.
|
|
48
|
+
|
|
49
|
+
Documentation: [Get Started with Projects](https://docs.jfrog.com/projects/docs),
|
|
50
|
+
[Basic Projects Terminology](https://docs.jfrog.com/projects/docs/basic-projects-terminology).
|
|
51
|
+
|
|
52
|
+
## Project role
|
|
53
|
+
|
|
54
|
+
Per-project role definition that scopes what members may do.
|
|
55
|
+
|
|
56
|
+
| Field | Description |
|
|
57
|
+
|-------|-------------|
|
|
58
|
+
| `name` | Role name (e.g. `Developer`, `Release Manager`) |
|
|
59
|
+
| `type` | `PREDEFINED` or `CUSTOM` |
|
|
60
|
+
| `environments` | List of environments where the role applies (e.g. `["DEV", "PROD"]`) |
|
|
61
|
+
| `actions` | Permitted actions within those environments |
|
|
62
|
+
|
|
63
|
+
Predefined role templates exist, but projects can define **custom roles**.
|
|
64
|
+
Two projects may have different custom roles or different definitions for
|
|
65
|
+
roles with the same name — always fetch per project when reporting.
|
|
66
|
+
|
|
67
|
+
API: `GET /access/api/v1/projects/<project-key>/roles`.
|
|
68
|
+
|
|
69
|
+
## Project member
|
|
70
|
+
|
|
71
|
+
A user or group assigned a role within a project.
|
|
72
|
+
|
|
73
|
+
| Field | Description |
|
|
74
|
+
|-------|-------------|
|
|
75
|
+
| `name` | Username or group name |
|
|
76
|
+
| `roles` | List of role names assigned in this project |
|
|
77
|
+
|
|
78
|
+
Membership is **not** the same as global platform administration. Roles are
|
|
79
|
+
evaluated in a project context — a user can be a Developer in one project
|
|
80
|
+
and a Release Manager in another.
|
|
81
|
+
|
|
82
|
+
API: `GET /access/api/v1/projects/<project-key>/users`,
|
|
83
|
+
`GET /access/api/v1/projects/<project-key>/groups`.
|
|
84
|
+
|
|
85
|
+
## Environment
|
|
86
|
+
|
|
87
|
+
Environments group resources and scope RBAC so that roles can have different
|
|
88
|
+
permissions per environment (e.g. separate DEV vs PROD behavior).
|
|
89
|
+
|
|
90
|
+
| Field | Description |
|
|
91
|
+
|-------|-------------|
|
|
92
|
+
| `name` | Environment name (e.g. `DEV`, `STAGING`, `PROD`) |
|
|
93
|
+
|
|
94
|
+
Environments can be defined at **global** scope (available across projects) or
|
|
95
|
+
**project** scope. Repositories can be assigned to one or more environments.
|
|
96
|
+
Environments are also used in release bundle promotion and application version
|
|
97
|
+
promotion (see `release-lifecycle-entities.md` and `apptrust-entities.md`).
|
|
98
|
+
|
|
99
|
+
API: `GET /access/api/v1/environments`.
|
|
100
|
+
|
|
101
|
+
Documentation: [Environments](https://docs.jfrog.com/administration/docs/environments).
|
|
102
|
+
|
|
103
|
+
## User
|
|
104
|
+
|
|
105
|
+
A platform identity that authenticates and is granted permissions.
|
|
106
|
+
|
|
107
|
+
| Field | Description |
|
|
108
|
+
|-------|-------------|
|
|
109
|
+
| `username` | Unique login name |
|
|
110
|
+
| `email` | Email address |
|
|
111
|
+
| `status` | `enabled` or `disabled` |
|
|
112
|
+
| `admin` | Whether the user has platform admin privileges |
|
|
113
|
+
| `groups` | Groups the user belongs to |
|
|
114
|
+
| `realm` | Authentication realm (e.g. `internal`, `ldap`, `saml`) |
|
|
115
|
+
|
|
116
|
+
Users can be managed via REST API or synced from external identity providers
|
|
117
|
+
(LDAP, SAML, SCIM).
|
|
118
|
+
|
|
119
|
+
API: `GET /access/api/v2/users/`, `GET /access/api/v2/users/<username>`.
|
|
120
|
+
|
|
121
|
+
## Group
|
|
122
|
+
|
|
123
|
+
A named collection of users that simplifies permission management.
|
|
124
|
+
|
|
125
|
+
| Field | Description |
|
|
126
|
+
|-------|-------------|
|
|
127
|
+
| `name` | Group name |
|
|
128
|
+
| `description` | Group description |
|
|
129
|
+
| `auto_join` | Whether new users automatically join this group |
|
|
130
|
+
| `admin_privileges` | Whether group members have admin privileges |
|
|
131
|
+
| `realm` | Source realm (e.g. `internal`, `ldap`) |
|
|
132
|
+
| `external_id` | External identity provider ID (for synced groups) |
|
|
133
|
+
|
|
134
|
+
Groups can be assigned permissions and project roles, applying them to all
|
|
135
|
+
members at once.
|
|
136
|
+
|
|
137
|
+
API: `GET /access/api/v2/groups/`, `GET /access/api/v2/groups/<group-name>`.
|
|
138
|
+
|
|
139
|
+
## Access token
|
|
140
|
+
|
|
141
|
+
A bearer credential with scoped permissions and optional expiry.
|
|
142
|
+
|
|
143
|
+
| Field | Description |
|
|
144
|
+
|-------|-------------|
|
|
145
|
+
| `token_id` | Unique token identifier |
|
|
146
|
+
| `subject` | The user or service the token represents |
|
|
147
|
+
| `scope` | Permission scope (e.g. `applied-permissions/admin`, `applied-permissions/groups:readers`) |
|
|
148
|
+
| `expires_in` | TTL in seconds (0 = non-expiring) |
|
|
149
|
+
| `refreshable` | Whether the token can be refreshed |
|
|
150
|
+
| `description` | Human-readable description |
|
|
151
|
+
|
|
152
|
+
Tokens are the primary authentication mechanism for API and CLI access.
|
|
153
|
+
They can be scoped to specific groups, projects, or admin-level permissions.
|
|
154
|
+
|
|
155
|
+
CLI: `jf access-token-create [username] [options]`.
|
|
156
|
+
|
|
157
|
+
API: `POST /access/api/v1/tokens`.
|
|
158
|
+
|
|
159
|
+
## Repository–Project assignment
|
|
160
|
+
|
|
161
|
+
A repository is linked to **at most one** project via the `projectKey` field
|
|
162
|
+
in its configuration.
|
|
163
|
+
|
|
164
|
+
| Rule | Detail |
|
|
165
|
+
|------|--------|
|
|
166
|
+
| **Authoritative field** | `projectKey` on the repository configuration |
|
|
167
|
+
| **Not authoritative** | Repository name — a naming pattern like `<project-key>-<suffix>` is a convention, not a guarantee |
|
|
168
|
+
| **Unassigned** | Missing or empty `projectKey` means the repo is not tied to any project |
|
|
169
|
+
|
|
170
|
+
## Agent rules
|
|
171
|
+
|
|
172
|
+
### 1. Repository to project (authoritative)
|
|
173
|
+
|
|
174
|
+
1. Obtain repository keys from `GET /api/repositories` (lite list).
|
|
175
|
+
2. For each key, call `GET /api/repositories/<repo-key>` and read `projectKey`.
|
|
176
|
+
3. Treat missing or empty `projectKey` as **unassigned**, regardless of
|
|
177
|
+
whether the repo name looks like `<project-key>-...`.
|
|
178
|
+
|
|
179
|
+
Do **not** infer project membership from naming alone. A name-prefix filter is
|
|
180
|
+
only a heuristic when detail calls are impossible, and is not authoritative.
|
|
181
|
+
|
|
182
|
+
Cost: one list plus N detail calls. Batch in one Shell invocation; reuse
|
|
183
|
+
captured JSON per SKILL.md "Preserving command output" when iterating with `jq`.
|
|
184
|
+
|
|
185
|
+
### 2. Project roles (per project)
|
|
186
|
+
|
|
187
|
+
For each `project_key` in a multi-project report or comparison, call:
|
|
188
|
+
|
|
189
|
+
`GET /access/api/v1/projects/<project-key>/roles`
|
|
190
|
+
|
|
191
|
+
Do **not** reuse one project's role payload as representative of all projects.
|
|
192
|
+
|
|
193
|
+
## Further reading
|
|
194
|
+
|
|
195
|
+
- [JFrog documentation URLs in this skill](jfrog-url-references.md)
|
|
196
|
+
- [Get Started with Projects](https://docs.jfrog.com/projects/docs)
|
|
197
|
+
- [Basic Projects Terminology](https://docs.jfrog.com/projects/docs/basic-projects-terminology)
|
|
198
|
+
- [Environments (Administration)](https://docs.jfrog.com/administration/docs/environments)
|
|
199
|
+
- [Projects API (interactive reference)](https://docs.jfrog.com/projects/reference)
|
|
200
|
+
- [Projects API (this skill)](projects-api.md)
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Platform Administration API Gaps
|
|
2
|
+
|
|
3
|
+
Operations available through REST API but not (or only partially) through the
|
|
4
|
+
CLI. Invoke all of them via `jf api` (see the base skill's *Invoking platform
|
|
5
|
+
APIs with `jf api`* section). Authentication is handled automatically from
|
|
6
|
+
the configured `jf` server — no token extraction needed. Every path includes
|
|
7
|
+
the product prefix (`/access/...`, `/artifactory/...`, `/xray/...`,
|
|
8
|
+
`/worker/...`).
|
|
9
|
+
|
|
10
|
+
## Users (full CRUD)
|
|
11
|
+
|
|
12
|
+
The CLI has `users-create` and `users-delete` but lacks GET and UPDATE.
|
|
13
|
+
|
|
14
|
+
### Get user details
|
|
15
|
+
```bash
|
|
16
|
+
jf api /access/api/v2/users/<username>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### List users
|
|
20
|
+
```bash
|
|
21
|
+
jf api /access/api/v2/users/
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Update user (partial)
|
|
25
|
+
```bash
|
|
26
|
+
jf api /access/api/v2/users/<username> \
|
|
27
|
+
-X PATCH -H "Content-Type: application/json" \
|
|
28
|
+
-d '{"email": "newemail@example.com"}'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Create user
|
|
32
|
+
```bash
|
|
33
|
+
jf api /access/api/v2/users/ \
|
|
34
|
+
-X POST -H "Content-Type: application/json" \
|
|
35
|
+
-d '{"username": "newuser", "email": "user@example.com", "password": "...", "admin": false}'
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Groups (full CRUD)
|
|
39
|
+
|
|
40
|
+
### Get group details
|
|
41
|
+
```bash
|
|
42
|
+
jf api /access/api/v2/groups/<groupname>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### List groups
|
|
46
|
+
```bash
|
|
47
|
+
jf api /access/api/v2/groups/
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Permissions (full CRUD)
|
|
51
|
+
|
|
52
|
+
### List permissions
|
|
53
|
+
```bash
|
|
54
|
+
jf api /access/api/v2/permissions/
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Get permission details
|
|
58
|
+
```bash
|
|
59
|
+
jf api /access/api/v2/permissions/<permission-name>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Access tokens (beyond CLI)
|
|
63
|
+
|
|
64
|
+
The CLI has `access-token-create` but not list or revoke.
|
|
65
|
+
|
|
66
|
+
### List tokens
|
|
67
|
+
```bash
|
|
68
|
+
jf api /access/api/v1/tokens
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Revoke token by ID
|
|
72
|
+
```bash
|
|
73
|
+
jf api /access/api/v1/tokens/<token-id> -X DELETE
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Environments
|
|
77
|
+
|
|
78
|
+
### List global environments
|
|
79
|
+
```bash
|
|
80
|
+
jf api /access/api/v1/environments
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Create global environment
|
|
84
|
+
```bash
|
|
85
|
+
jf api /access/api/v1/environments \
|
|
86
|
+
-X POST -H "Content-Type: application/json" \
|
|
87
|
+
-d '{"name": "STAGING"}'
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Projects
|
|
91
|
+
|
|
92
|
+
See `references/projects-api.md` for full project CRUD, members, roles, and
|
|
93
|
+
environments.
|
|
94
|
+
|
|
95
|
+
## Webhooks
|
|
96
|
+
|
|
97
|
+
### List webhooks
|
|
98
|
+
```bash
|
|
99
|
+
jf api /access/api/v1/webhooks
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Create webhook
|
|
103
|
+
```bash
|
|
104
|
+
jf api /access/api/v1/webhooks \
|
|
105
|
+
-X POST -H "Content-Type: application/json" \
|
|
106
|
+
-d '{"key": "my-webhook", "url": "https://example.com/hook", "event_types": ["uploaded"]}'
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## System health
|
|
110
|
+
|
|
111
|
+
### Platform ping
|
|
112
|
+
```bash
|
|
113
|
+
jf api /artifactory/api/system/ping
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Artifactory version
|
|
117
|
+
```bash
|
|
118
|
+
jf api /artifactory/api/system/version
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Xray ping
|
|
122
|
+
```bash
|
|
123
|
+
jf api /xray/api/v1/system/ping
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Xray version
|
|
127
|
+
```bash
|
|
128
|
+
jf api /xray/api/v1/system/version
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## OIDC configuration
|
|
132
|
+
|
|
133
|
+
### List OIDC providers
|
|
134
|
+
```bash
|
|
135
|
+
jf api /access/api/v1/oidc
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Create OIDC configuration
|
|
139
|
+
```bash
|
|
140
|
+
jf api /access/api/v1/oidc \
|
|
141
|
+
-X POST -H "Content-Type: application/json" \
|
|
142
|
+
-d '{"name": "my-oidc", "issuer_url": "https://...", "provider_type": "generic"}'
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## SCIM (user provisioning)
|
|
146
|
+
|
|
147
|
+
### Get SCIM users
|
|
148
|
+
```bash
|
|
149
|
+
jf api /access/api/v1/scim/v2/Users
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Workers (beyond CLI)
|
|
153
|
+
|
|
154
|
+
The CLI covers most worker operations. These are API-only:
|
|
155
|
+
|
|
156
|
+
### Get available actions
|
|
157
|
+
```bash
|
|
158
|
+
jf api /worker/api/v1/actions
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Get actions metadata
|
|
162
|
+
```bash
|
|
163
|
+
jf api /worker/api/v1/actions/metadata
|
|
164
|
+
```
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Platform Administration Operations
|
|
2
|
+
|
|
3
|
+
CLI and REST commands for platform-wide administration: access tokens, login,
|
|
4
|
+
stats, projects, and system health.
|
|
5
|
+
|
|
6
|
+
## Access tokens
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
jf access-token-create [username] [options]
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Key options: `--groups`, `--scope`, `--expiry`, `--refreshable`, `--description`.
|
|
13
|
+
|
|
14
|
+
## Login
|
|
15
|
+
|
|
16
|
+
For login, see `references/jfrog-login-flow.md`.
|
|
17
|
+
|
|
18
|
+
## Stats
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
jf stats rt [--server-id <id>] [--format json|table]
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Projects
|
|
25
|
+
|
|
26
|
+
Projects are managed via the Access API (no CLI subcommand). Invoke the
|
|
27
|
+
endpoints through `jf api` (see the base skill's *Invoking platform APIs
|
|
28
|
+
with `jf api`* section). Authentication is handled automatically:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
jf api /access/api/v1/projects
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- **List projects**: `GET /access/api/v1/projects`
|
|
35
|
+
- **Get project**: `GET /access/api/v1/projects/<project-key>`
|
|
36
|
+
- **List members**: `GET /access/api/v1/projects/<project-key>/users`
|
|
37
|
+
- **List groups**: `GET /access/api/v1/projects/<project-key>/groups`
|
|
38
|
+
- **List roles**: `GET /access/api/v1/projects/<project-key>/roles`
|
|
39
|
+
- **List environments**: `GET /access/api/v1/environments`
|
|
40
|
+
|
|
41
|
+
When querying multiple projects, batch the calls in a single Shell invocation
|
|
42
|
+
to avoid per-project round-trips:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
for proj in proj1 proj2 proj3; do
|
|
46
|
+
jf api "/access/api/v1/projects/$proj/users"
|
|
47
|
+
done
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Read `references/projects-api.md` for detailed endpoint patterns including
|
|
51
|
+
creating/updating projects, managing members, and assigning repositories.
|
|
52
|
+
|
|
53
|
+
## System health
|
|
54
|
+
|
|
55
|
+
Not available as a dedicated CLI subcommand. Use:
|
|
56
|
+
```bash
|
|
57
|
+
jf api /artifactory/api/system/ping
|
|
58
|
+
```
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# JFrog Projects API
|
|
2
|
+
|
|
3
|
+
**See also:** `references/platform-access-entities.md` for how Projects relate to
|
|
4
|
+
repositories, members, roles, and environments.
|
|
5
|
+
|
|
6
|
+
Projects are managed through the Access API. There is no CLI subcommand —
|
|
7
|
+
invoke the endpoints via `jf api` (see the base skill's *Invoking platform
|
|
8
|
+
APIs with `jf api`* section). Authentication against the resolved JFrog
|
|
9
|
+
server is automatic.
|
|
10
|
+
|
|
11
|
+
All endpoints below use full product-prefixed paths (`/access/api/...`,
|
|
12
|
+
`/artifactory/api/...`).
|
|
13
|
+
|
|
14
|
+
## Authentication
|
|
15
|
+
|
|
16
|
+
Credentials are resolved automatically by `jf api` from the active `jf config`
|
|
17
|
+
server — no token extraction or `curl` wiring is needed.
|
|
18
|
+
|
|
19
|
+
## Projects
|
|
20
|
+
|
|
21
|
+
### List all projects
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
jf api /access/api/v1/projects
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Returns an array of project objects with `project_key`, `display_name`,
|
|
28
|
+
`description`, `admin_privileges`, `storage_quota_bytes`, etc.
|
|
29
|
+
|
|
30
|
+
### Get a single project
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
jf api /access/api/v1/projects/<project-key>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Create a project
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
jf api /access/api/v1/projects \
|
|
40
|
+
-X POST -H "Content-Type: application/json" \
|
|
41
|
+
-d '{
|
|
42
|
+
"display_name": "My Project",
|
|
43
|
+
"description": "Project description",
|
|
44
|
+
"admin_privileges": {
|
|
45
|
+
"manage_members": true,
|
|
46
|
+
"manage_resources": true,
|
|
47
|
+
"index_resources": true
|
|
48
|
+
},
|
|
49
|
+
"project_key": "myproj"
|
|
50
|
+
}'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The `project_key` must be 2-32 lowercase alphanumeric characters (hyphens
|
|
54
|
+
allowed, no leading/trailing hyphen).
|
|
55
|
+
|
|
56
|
+
### Update a project
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
jf api /access/api/v1/projects/<project-key> \
|
|
60
|
+
-X PUT -H "Content-Type: application/json" \
|
|
61
|
+
-d '{"display_name": "Updated Name", "description": "Updated description"}'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Delete a project
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
jf api /access/api/v1/projects/<project-key> -X DELETE
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Members
|
|
71
|
+
|
|
72
|
+
### List project members (users)
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
jf api /access/api/v1/projects/<project-key>/users
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Returns `{"members": [{"name": "<username>", "roles": ["<role-name>"]}]}`.
|
|
79
|
+
|
|
80
|
+
### Add a member
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
jf api /access/api/v1/projects/<project-key>/users/<username> \
|
|
84
|
+
-X PUT -H "Content-Type: application/json" \
|
|
85
|
+
-d '{"name": "<username>", "roles": ["Developer"]}'
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Remove a member
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
jf api /access/api/v1/projects/<project-key>/users/<username> -X DELETE
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### List project groups
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
jf api /access/api/v1/projects/<project-key>/groups
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The response may list group entries under **`members`**, **`groups`**, or both,
|
|
101
|
+
depending on platform version (same general shape as users: `name` and
|
|
102
|
+
`roles`). Parsers should accept whichever key is present.
|
|
103
|
+
|
|
104
|
+
### Add a group
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
jf api /access/api/v1/projects/<project-key>/groups/<group-name> \
|
|
108
|
+
-X PUT -H "Content-Type: application/json" \
|
|
109
|
+
-d '{"name": "<group-name>", "roles": ["Contributor"]}'
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Roles
|
|
113
|
+
|
|
114
|
+
### List project roles
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
jf api /access/api/v1/projects/<project-key>/roles
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Returns an array of role objects. Each has `name`, `description`, `type`
|
|
121
|
+
(`PREDEFINED`, `ADMIN`, or `CUSTOM`), `environments` (e.g. `["DEV","PROD"]`),
|
|
122
|
+
and `actions` (permission strings).
|
|
123
|
+
|
|
124
|
+
Predefined roles: Project Admin, Developer, Contributor, Viewer, Release
|
|
125
|
+
Manager, Security Manager, AppTrust Manager, Model Governor, Model Developer.
|
|
126
|
+
|
|
127
|
+
**Multi-project reports:** Call this endpoint **once per `project_key`**. Custom
|
|
128
|
+
roles and definitions can differ by project; do not assume one project's role
|
|
129
|
+
list matches another. See `references/platform-access-entities.md`.
|
|
130
|
+
|
|
131
|
+
### Create a custom role
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
jf api /access/api/v1/projects/<project-key>/roles \
|
|
135
|
+
-X POST -H "Content-Type: application/json" \
|
|
136
|
+
-d '{
|
|
137
|
+
"name": "QA Engineer",
|
|
138
|
+
"description": "Read and annotate repos in DEV",
|
|
139
|
+
"type": "CUSTOM",
|
|
140
|
+
"environments": ["DEV"],
|
|
141
|
+
"actions": ["READ_REPOSITORY", "ANNOTATE_REPOSITORY", "READ_BUILD"]
|
|
142
|
+
}'
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Environments
|
|
146
|
+
|
|
147
|
+
The product supports **global** and **project-scoped** environment concepts for
|
|
148
|
+
RBAC and resource grouping; see
|
|
149
|
+
[Environments (Administration)](https://docs.jfrog.com/administration/docs/environments)
|
|
150
|
+
and `references/platform-access-entities.md`.
|
|
151
|
+
|
|
152
|
+
### List environments (platform API)
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
jf api /access/api/v1/environments
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Returns `[{"name": "DEV"}, {"name": "PROD"}, ...]` -- the platform environment
|
|
159
|
+
list available through this Access API path.
|
|
160
|
+
|
|
161
|
+
### Create an environment
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
jf api /access/api/v1/environments \
|
|
165
|
+
-X POST -H "Content-Type: application/json" \
|
|
166
|
+
-d '{"name": "STAGING"}'
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Environment names are uppercase by convention.
|
|
170
|
+
|
|
171
|
+
## Repository assignment
|
|
172
|
+
|
|
173
|
+
### Assign a repository to a project
|
|
174
|
+
|
|
175
|
+
Assign a repository to a project by updating its configuration:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
jf api /artifactory/api/repositories/<repo-key> \
|
|
179
|
+
-X POST -H "Content-Type: application/json" \
|
|
180
|
+
-d '{"projectKey": "<project-key>"}'
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### List repositories for a project
|
|
184
|
+
|
|
185
|
+
`GET /artifactory/api/repositories` supports optional query parameters that can
|
|
186
|
+
be combined:
|
|
187
|
+
|
|
188
|
+
| Parameter | Values | Example |
|
|
189
|
+
|-----------|--------|---------|
|
|
190
|
+
| `project` | project key | `?project=myproj` |
|
|
191
|
+
| `type` | `local`, `remote`, `virtual` | `?type=local` |
|
|
192
|
+
| `packageType` | `docker`, `maven`, `npm`, etc. | `?packageType=docker` |
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# All repos in a project
|
|
196
|
+
jf api "/artifactory/api/repositories?project=<project-key>"
|
|
197
|
+
|
|
198
|
+
# Only local Docker repos in a project
|
|
199
|
+
jf api "/artifactory/api/repositories?project=<project-key>&type=local&packageType=docker"
|
|
200
|
+
|
|
201
|
+
# All remote repos (no project filter)
|
|
202
|
+
jf api "/artifactory/api/repositories?type=remote"
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Returns a lite list with `key`, `type`, `packageType`, and `url` per repo.
|
|
206
|
+
See `references/artifactory-api-gaps.md` for additional filter examples.
|
|
207
|
+
|
|
208
|
+
### Get repository detail
|
|
209
|
+
|
|
210
|
+
To retrieve the full configuration of a specific repository (including fields
|
|
211
|
+
like `projectKey`, `description`, storage settings, etc. that are absent from
|
|
212
|
+
the lite list), use the detail endpoint:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
jf api "/artifactory/api/repositories/<repo-key>"
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Use this when you have a specific repo or a short list of repos to inspect --
|
|
219
|
+
not for filtering large sets. For filtering, use the query parameters above.
|
|
220
|
+
|
|
221
|
+
### Name-prefix heuristic (unreliable -- last resort)
|
|
222
|
+
|
|
223
|
+
Project-scoped repos often follow a `<project-key>-*` naming convention, but
|
|
224
|
+
the API does **not** enforce this. Repos can belong to a project without the
|
|
225
|
+
prefix, or carry the prefix without belonging. Always prefer
|
|
226
|
+
`?project=<project-key>` for authoritative results. Use name-prefix matching
|
|
227
|
+
only when the `project` query parameter is unavailable (e.g. older Artifactory
|
|
228
|
+
versions).
|
|
229
|
+
|
|
230
|
+
## Common error responses
|
|
231
|
+
|
|
232
|
+
- **Empty members/groups**: projects with no members return
|
|
233
|
+
`{"members": []}`, not 404. The groups list endpoint may use the same
|
|
234
|
+
`members` key for group entries; empty lists look like `{"members": []}`.
|
|
235
|
+
Always check the array rather than the status code alone.
|
|
236
|
+
- **Invalid project key on create**: returns 400 if `project_key` is outside
|
|
237
|
+
2-32 chars, contains uppercase letters, or has leading/trailing hyphens.
|
|
238
|
+
- **Project not found**: returns 404 with `{"errors": [{"message": "..."}]}`.
|
|
239
|
+
- **Insufficient permissions**: `jf api` exits with code 1 on non-2xx and
|
|
240
|
+
prints `[Warn] jf api: ... returned 403` on stderr when the token lacks
|
|
241
|
+
project admin or platform admin privileges.
|