One objective of Artipie is to provide APIs that are compatible with Artifactory APIs so that customers can have an easy and smooth transition from Artifactory to Artipie if they choose to. The set of APIs are to manage repositories, users, repository permissions and more.
Creates new docker repository with default storage alias and provided name.
PUT /api/repositories/{repoKey}
Consumes json with the following fields (any other fields are ignored):
| Field name | Type | Meaning | Required |
|---|---|---|---|
| key | string | New repository name | Y |
| rclass | string | Repository class, only local type is supported |
Y |
| packageType | string | Artifact type, only docker type is supported |
Y |
| dockerApiVersion | string | Docker API version, we only support V2 |
Y |
Possible responses:
200 OKwhen new repository was successfully created400 BAD REQUESTin the cases when repository with such name already exists or invalid json was sent500 INTERNAL ERRORin the case of unexpected server error
Artifactory documentation can be found here.
Endpoint to obtain list of the existing users.
GET /api/security/users
Returns json array of the following form:
[
{
"name": "davids",
"uri" : "http://localhost:8081/artifactory/api/security/users/davids",
"realm" : "Internal"
}, {
"name": "danl",
"uri" : "http://localhost:8081/artifactory/api/security/users/danl",
"realm" : "Internal"
}
]Where name field contains user name, uri - URI to obtain user details, user realm is always Internal.
Endpoint to obtain user details.
GET /api/security/users/{userName}
Returns json with the following fields:
| Field name | Type | Meaning | Required |
|---|---|---|---|
| name | string | User name | Y |
| string | User email | Y | |
| lastLoggedIn | string | Default 2020-01-01T01:01:01.000+01:00 |
Y |
| realm | string | User realm, value Internal is always returned |
Y |
| groups | json array | User groups | Y |
If user is not found 404 NOT FOUND status is returned.
Creates, replaces or updates user with {userName} from request URL.
PUT/POST /api/security/users/{userName}
Consumes json with the following fields (any other fields are ignored):
| Field name | Type | Meaning | Required |
|---|---|---|---|
| password | string | User password | Y |
| string | User email | Y | |
| groups | json array | User groups | N |
Possible responses:
200 OKwhen user was successfully created or updated400 BAD REQUESTwhen invalid json was sent500 INTERNAL ERRORin the case of unexpected server error
Removes an Artipie user.
DELETE /api/security/users/{userName}
Possible responses:
200 OK User '{userName}' has been removed successfully.when user with{userName}was successfully removed404 NOT FOUNDwhen user was not found500 INTERNAL ERRORin the case of unexpected server error
Endpoint to obtain the permission targets list. From the Artipie point of view permission target is a repository, so basically this endpoint returns list of the existing repositories.
GET /api/security/permissions
Returns json array of the following form:
[
{
"name": "readSourceArtifacts",
"uri" : "http://localhost:8081/artifactory/api/security/permissions/readSourceArtifacts"
}, {
"name": "populateCaches",
"uri" : "http://localhost:8081/artifactory/api/security/permissions/populateCaches"
}
]Where name is a permission target name and uri - URI to obtain permission target details.
Endpoint to get the details of a Permission Target, or, if other words, Artipie repository permissions details.
GET /api/security/permissions/{permissionTargetName}
Returns json of the following format:
{
"includesPattern": "**",
"repositories": ["{permissionTargetName}"],
"principals": {
"users" : {
"bob": ["r", "w", "m"],
"alice" : ["d", "w", "r"]
},
"groups" : {
"readers": ["r"],
"a-team" : ["w", "r"]
}
}
}Fields description:
| Field name | Type | Meaning | Required |
|---|---|---|---|
| includesPattern | string | Path patterns to apply permissions to | Y |
| repositories | json array | Repository name, always one-element array with the {permissionTargetName} item |
Y |
| principals | json object | Repository permissions details, contains users element with user permission details and groups element with group permission details |
Y |
The set of supported permissions along with the shortening convention:
w=deploy; m=admin; r=read; d=delete (`delete` is supported for file storage only)
If requested {permissionTargetName} does not exist, 404 NOT FOUND status is returned.
Creates or updates repository permissions.
PUT /api/security/permissions/{permissionTargetName}
Consumes json of the following form:
{
"repo": {
"include-patterns": ["**"],
"actions": {
"users" : {
"bob": ["read", "write", "manage"],
"alice" : ["write", "read"]
},
"groups" : {
"readers": ["read"],
"a-team" : ["write", "read"]
}
}
}
}where fields users and groups contain list of the user or group names and corresponding permissions,
all other fields are ignored.
The following synonyms and shortened values for standard operations are supported:
read-rwrite-w,deploydelete-dmanage(any operation is allowed) -m,admin
include-patterns is an optional argument (value ["**"] is set by default)
which allows specifying path patterns to apply permissions to.
Path patterns are specified by Ant-like expressions.
Possible responses:
200 OKwhen permissions were added successfully500 INTERNAL ERRORin the case of unexpected server error400 BAD REQUESTin the cases when repository name does not exist orinclude-patternsformat is invalid
Deletes permission target, that is removes all permissions for repository leaving repository inaccessible.
DELETE /api/security/permissions/{permissionTargetName}
Possible responses:
200 OK Permission Target '{permissionTargetName}' has been removed successfully.when user with{permissionTargetName}was successfully removed404 NOT FOUNDwhen repository with{permissionTargetName}was not found500 INTERNAL ERRORin the case of unexpected server error
Get a flat listing of the items within a repository.
GET /api/storage/{repoKey}/{path}
Returns json array of the following format:
{
"files": [
{
"uri": "/doc.txt",
"folder": "false"
},
{
"uri": "/one",
"folder": "true"
}
]
}where uri is a storage item name and folder flag indicates whether item is a folder or not.