Skip to main content

Deputy Package Server

Config.yml

The config.yml file contains configuration settings for the Deputy Package Server.

config.yml

hostname: 0.0.0.0:8080
package_folder: /var/opt/deputy/deputy-package-server/packages
database_url: mysql://mysql_user:mysql_pass@deputy-mariadb:3306/deputy
keycloak:
pem_content: keycloak_public_key #change me
  • Hostname: specifies the host and port on which Deputy Package Server will listen
  • Package_folder: defines the folder path where packages are stored
  • Database_url: defines the URL for connecting to the MySQL database
  • Keycloak pem_content - PEM content for the public key used by Keycloak

API Functionality

Deputy Package Server provides a comprehensive API for managing and distributing packages. The API supports various functionalities, including API token, package owner and package related calls.

API Token

Endpoint: /api/v1/token
Method: POST
Description: Creates a new token for the user.
Authentication: Keycloak token authentication.

Endpoint: /api/v1/token
Method: GET
Description: Returns all tokens for the user.
Authentication: Keycloak token authentication.

Endpoint: /api/v1/token/{token-id}
Method: DELETE
Description: Deletes a token for the user.
Authentication: Keycloak token authentication.

Owner

Endpoint: /api/v1/package/{package-name}/owner
Method: POST
Description: Adds a new owner to a package.
Authentication: ownership authentication

Endpoint: /api/v1/package/{package-name}/owner
Method: GET
Description: Returns all owners of a package.
Authentication: ownership authentication

Endpoint: /api/v1/package/{package-name}/owner/{owner-email}
Method: DELETE
Description: Removes the owner from a package.
Authentication: ownership authentication

Package

Endpoint: /api/v1/package
Method: POST
Description: Uploads a new package to the server.
Authentication: local token authentication.

Endpoint: /api/v1/package
Method: GET
Description: Returns all packages.

Endpoint: /api/v1/package/{package-name}
Method: GET
Description: Returns all versions of a package.

Endpoint: /api/v1/package/{package-name}/{version}/download
Method: GET
Description: Downloads a package.

Endpoint: /api/v1/package/{package-name}/{version}/path/{tail:.*}
Method: GET
Description: Downloads a file.

Endpoint: /api/v1/package/{package-name}/{version}
Method: GET
Description: Returns a specific version of a package.

Endpoint: /api/v1/package/{package-name}/{version}/yank/{set_yank}
Method: PUT
Description: Removes or un-removes a package from the server.
Authentication: ownership and local token authentication.