dotCMS / dotCMS/core

feat(apps): Add PUT /api/v1/apps/{key} endpoint to update an existing App descriptor

Open
#34,982 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OKR : Customer Support stale
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem

There is no way to update a user-uploaded App YAML descriptor without fully deleting and re-uploading it. The current POST /api/v1/apps/ endpoint throws AlreadyExistException if the descriptor file already exists on disk, making it impossible to update an app definition in place.

This forces developers and system administrators into a fragile multi-step workaround: DELETE /api/v1/apps/{key}?removeDescriptor=true followed by POST /api/v1/apps/ — which loses all existing configuration context and is error-prone.

Goal

Expose a PUT /api/v1/apps/{key} endpoint that allows updating the YAML descriptor of an existing user-uploaded app. The key is preserved (derived from the existing filename on disk), system apps are protected, and the cache is invalidated on success.

Target Personas

  • Developer teams
  • DevOps teams
  • System administrators (dotCMS)

Demo Expectations

In the demo, we will show:

  1. An existing app visible via GET /api/v1/apps/{key}
  2. A PUT /api/v1/apps/{key} call uploading a modified YAML (e.g. updated description or added param)
  3. GET /api/v1/apps/{key} immediately returning the updated descriptor — no delete/re-upload needed

Acceptance Criteria

  • PUT /api/v1/apps/{key} endpoint exists, consumes multipart/form-data, and requires backend authentication
  • Returns 200 OK with the updated AppView on success
  • Returns 404 if the app key does not exist
  • Returns 403 if the target app is a system app
  • The app key is preserved — overwrite uses the existing filename on disk, not the uploaded file's name
  • Uploaded YAML is validated via validateAppDescriptor() before writing
  • Cache is invalidated after a successful update
  • Security log entry is written on successful update
  • Unit and integration tests cover: happy path, system app rejection, non-existent key, invalid YAML

User Stories

  • As a developer, I want to PUT /api/v1/apps/{key} with an updated YAML file, so that I can evolve my app definition without disrupting existing secrets or configurations
  • As a system administrator, I want system apps to be protected from PUT updates, so that built-in integrations remain stable

Technical Scope

Changes required across 4 files:

File Change
AppsAPI.java Add updateAppDescriptor(String key, File file, User user) to interface
AppsAPIImpl.java Implement: validate → check not system app → overwrite existing file → invalidate cache
AppsHelper.java Add updateApp(String key, FormDataMultiPart, User) delegating to API
AppsResource.java Add PUT /{key} endpoint consuming multipart/form-data

Links

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading AppsAPI.java, AppsAPIImpl.java, AppsHelper.java, and AppsResource.java to trace the existing app upload and retrieval flow. Run the relevant app API tests if available, then add coverage for successful updates, system-app and missing-key rejection, and invalid YAML. Done means the PUT endpoint validates and overwrites the existing descriptor, preserves its key, invalidates the cache, and records a security log.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.