Skip to content

feat(spaces): add Spaces access key List, Get, Create and Delete tasks - #25

Merged
jymaire merged 3 commits into
kestra-io:mainfrom
PedroHenrique0713:feat/spaces-keys
Oct 13, 2026
Merged

jymaire merged 3 commits into
kestra-io:mainfrom
PedroHenrique0713:feat/spaces-keys

Conversation

@PedroHenrique0713

Copy link
Copy Markdown
Contributor

What changes are being made and why?

Closes #24 (part of #10). This is the Spaces keys slice, after Snapshots (#17), Billing (#18) and Block Storage Actions (#23).

There was no way to manage Spaces access keys from a flow, e.g. to create a key scoped to one bucket for a job and revoke it afterwards. This adds a spaces.key subgroup on /v2/spaces/keys:

  • spaces.key.List: lists the keys, optionally filtered by name, bucket or permission
  • spaces.key.Get: reads one key's name and bucket grants
  • spaces.key.Create: creates a key with bucket grants (READ or READWRITE), or a single FULLACCESS grant
  • spaces.key.Delete: revokes a key

DigitalOcean returns the secret key only once, in the create response. Create outputs it as an EncryptedString, the same way plugin-aws' GetAuthToken and plugin-ceph's CreateUser expose credentials, so it is not stored in cleartext in the execution outputs, and a later task still gets the plain value through {{ outputs.create_key.secretKey }}. Get and List never include it.

Create also rejects FULLACCESS mixed with bucket-scoped grants and a scoped grant without a bucket before calling the API: the API docs say FULLACCESS takes priority when both are sent, which would silently widen the key.

I left out the update endpoint: the docs say only the name can be changed, so it didn't seem worth a task.

Endpoints and fields taken from DigitalOcean's OpenAPI spec, plus the metadata, icon and docs entries for the new subgroup.


How the changes have been QAed?

  • 16 new WireMock tests: the exact create body for scoped, FULLACCESS (empty bucket) and no grants, the secret encrypted in the output and decrypting back to the original value, both grant validations with no request sent, list filters sent as query params, 400, 404 and 429, and one per task rendering its properties from Pebble expressions (grants included). The full suite passes (155/155, rebased on main after feat(snapshot): add snapshot tasks and volume CreateSnapshot #17 and feat(billing): add balance, billing history and invoice tasks #18). Dropping the encryption, sending a null bucket for FULLACCESS, removing the mixed-grants check or sending the permission in uppercase each makes a test fail. I added an encryption key to src/test/resources/application.yml for the encryption test.
  • Built the jar and ran it on Kestra 2.0.5, with an encryption key configured, against a small local mock of the DigitalOcean API, with this flow (baseUrl points to the mock; drop it to hit the real API):
id: digitalocean_rotate_spaces_key
namespace: company.team

tasks:
  - id: create_key
    type: io.kestra.plugin.digitalocean.spaces.key.Create
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://host.docker.internal:18998
    name: reports-reader
    grants:
      - bucket: reports
        permission: READ

  - id: get_key
    type: io.kestra.plugin.digitalocean.spaces.key.Get
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://host.docker.internal:18998
    accessKey: "{{ outputs.create_key.accessKey }}"

  - id: list_bucket_keys
    type: io.kestra.plugin.digitalocean.spaces.key.List
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://host.docker.internal:18998
    bucket: reports

  - id: delete_old_key
    type: io.kestra.plugin.digitalocean.spaces.key.Delete
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://host.docker.internal:18998
    accessKey: DO00EXISTINGKEY01

  - id: summary
    type: io.kestra.plugin.core.log.Log
    message: >
      Created {{ outputs.get_key.name }} ({{ outputs.create_key.accessKey }}) with {{ outputs.get_key.grants | length }} grant(s);
      {{ outputs.list_bucket_keys.total }} key(s) had access to the reports bucket before the old one was deleted.

The secret's plain value appears nowhere in the execution or its logs. A second flow passed {{ outputs.create_key.secretKey }} to an HTTP request, and the mock received the exact secret it had issued.

Before / after

Plugin list: the new Spaces Keys group shows up. The screenshots were taken before #17 and #18 landed, so the Snapshots and Billing groups are not in them.

Before: plugin list After: plugin list with Spaces Keys

Editor: the released plugin rejects spaces.key.Create, this branch validates it.

Before: the editor rejects spaces.key.Create After: the flow validates

The demo flow running end to end, and the stored create_key output with the secret encrypted.

After: demo flow execution After: create_key output with the secret encrypted


Setup Instructions

A DigitalOcean API token in a DIGITALOCEAN_TOKEN secret, with the spaces_key scopes the tasks need (spaces_key:read, spaces_key:create_credentials, spaces_key:delete). To get the secret key encrypted in the outputs, Kestra needs kestra.encryption.secret-key configured; without it Kestra stores the output as is and logs a warning.


Contributor Checklist ✅

@kestrabot kestrabot Bot added this to Pull Requests Oct 9, 2026
@MilosPaunovic MilosPaunovic added the area/plugin Plugin-related issue or feature request label Oct 12, 2026
@MilosPaunovic
MilosPaunovic requested review from a team and Malaydewangan09 October 12, 2026 07:43
@MilosPaunovic MilosPaunovic added the kind/external Pull requests raised by community contributors label Oct 12, 2026

@jymaire jymaire left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kestra Plugin Code Review

Business Requirements — met

The PR delivers the spaces.key List, Get, Create and Delete tasks described in #24 on /v2/spaces/keys, with grant validation in Create and the secret key returned only by Create.

Kestra Guidelines — 2 findings

  • 🟢 Create.java:122 [Guidelines] Multi-line javadoc
  • 🟢 Create.java:154 [Guidelines] Output duplicates KeyOutput

Checked and fine: Lombok annotations, apiToken secret and @ToString.Exclude (inherited), Property<T> everywhere, @Schema on all properties and outputs, full runnable @Examples with secret(), VoidOutput with return null, package-info.java (CLOUD), spaces.key.yaml, index.yaml, the doc .md, the icon (same as the other subgroups), and AGENTS.md / README.md (they describe only what this diff adds).

Security (OWASP Top 10:2025 + KPS) — 0 blocking findings

  • Create outputs the secret key as EncryptedString (KPS-01). This is the accepted pattern and is documented in the task, the doc .md, and the metadata. The secret is not logged (KPS-02): the log lines carry only the key name, the access key and the grant count. Get and List never return it.
  • Residual point for the maintainers: without kestra.encryption.secret-key Kestra stores the output in cleartext (the PR description says so; the task text only says it "requires" the key).

Performance — 0 findings

✅ No issues found. List uses the shared paginated fetchAllPages with a reused client and a page cap.

Other checks

  • API: endpoints, keys / key wrappers, lowercase permission values, empty bucket for FULLACCESS and the filters (name, bucket, permission) match DigitalOcean's Spaces keys API as I know it. Pagination uses per_page and links.pages.next; I checked the code, not the live API.
  • Kestra 1.3 / 2.0: kestraVersion=1.3.39. The diff uses EncryptedString, Property, HttpRequest and VoidOutput only, and no core API changed in 2.0. The author reports running the jar on 2.0.5.
  • Tests: I ran the 4 spaces.key test classes locally (1 worker, no daemon): 16/16 pass. Every task has an unconditional WireMock happy-path test.
  • Overlap: the diff touches no .github/, build.gradle or gradle.properties file. #29 (bearer fix in AbstractDigitalOceanTask) is independent of these files, but all four tasks go through the same HTTP layer, so they benefit from it once merged. #23 also edits AGENTS.md and io.kestra.plugin.digitalocean.md, so the second of the two to merge will probably need a rebase.

Verdict: recommend APPROVE (non-blocking nits only; final call and approval stay with the maintainers)

Also trims the grant validation comment to one line.
@PedroHenrique0713

Copy link
Copy Markdown
Contributor Author

Thanks for the review. 2 of 2 addressed in e47ef90:

  • 🟢 Create.java:122: the javadoc is now a one-line comment.
  • 🟢 Create.java:154: KeyOutput now uses @SuperBuilder and Create.Output extends it, adding only secretKey. run() fills the shared fields through KeyOutput.withKeyFields(...) instead of copying them. The serialized output and the generated output schema still expose the same five fields. Suite: 155/155.

@fdelbrayelle fdelbrayelle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kestra Plugin Code Review

Business Requirements — met

spaces.key List, Get, Create and Delete on /v2/spaces/keys as asked in #24, with grant validation in Create and the secret key returned only by Create, as an EncryptedString.

Previous Review Follow-up — 2 of 2 addressed

Baseline: 2262df71c5 (review by kestra-io member jymaire). Head: e47ef90724.

  • ✅ Create.java:122 multi-line javadoc: now a single-line comment above validateGrants.
  • ✅ Create.java:154 Output duplicates KeyOutput: KeyOutput is now @SuperBuilder, Create.Output extends KeyOutput and only adds secretKey; run() fills shared fields through KeyOutput.withKeyFields(...).
    Those threads belong to another reviewer, so I left them unresolved.

Kestra Guidelines — 0 findings

✅ No violations in the new commit (unused imports removed, no leftover @Builder).

Security (OWASP Top 10:2025 + KPS) — 0 findings

✅ No issues found. The secret stays encrypted in outputs (KPS-01) and is not logged (KPS-02). The PR touches no .github/, build.gradle* or gradle.properties file. The only test resource change is a dummy encryption key in src/test/resources/application.yml, used for the encryption test.

Performance — 0 findings

✅ No issues found.

Static review only: I did not build or run tests locally. The fork CI run on this head was pending approval and has been approved.

Verdict: APPROVE

@jymaire

jymaire commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

QA report: Spaces access keys (head e47ef90)

Edition: OSS | Docker tags: v1.3.42 (latest on the PR's kestraVersion=1.3.39 line) and v2.0.5 (latest 2.0.x)
Instance: qa-digitalocean25-kestra on network qa-digitalocean25-net (local to the QA machine, left running on 2.0.5 with the encryption key set; docker rm -f qa-digitalocean25-kestra && docker network rm qa-digitalocean25-net to stop)
Screenshots: https://claude.ai/artifact/Tyqud8mGZYZXAUTsJb9rg2

Result: PASS. No new HIGH or MEDIUM issue. All 15 flows behave the same on 1.3.42 and 2.0.5.

Setup

  • JAR built from the PR head (shadowJar, 1 worker, no daemon; no build file changed in the PR), mounted alone at /app/plugins.
  • DigitalOcean API mocked by a small stateful HTTP server on the QA network (POST/GET /v2/spaces/keys, GET/DELETE /v2/spaces/keys/{accessKey} with 404, a 429 case, filters and links.pages.next pagination, plus /v2/customers/my/balance). The mock also answers as api.digitalocean.com with port 443 closed, so nothing can reach the real API. It records every request (all carried the bearer token from a Kestra secret) and every secret key it issues. Every flow sets baseUrl to the mock.
  • Each version was run twice: with kestra.encryption.secret-key set, then unset.
  • Real DigitalOcean: NOT TESTABLE (no account).

Secret key handling (scope focus)

Check 1.3.42 key set 2.0.5 key set 1.3.42 key unset 2.0.5 key unset
secretKey stored as {value, type: io.kestra.datatype:aes_encrypted} ✅ AES ciphertext ✅ AES ciphertext plaintext value + WARN Unable to encrypt the output as encryption is not configured same as 1.3.42
Issued secret found in clear in stored outputs (scanned against what the mock issued) ✅ no ✅ no yes (expected without a key) yes (expected without a key)
Issued secret found in any log line ✅ no ✅ no ✅ no ✅ no
{{ outputs.create_key.secretKey }} gives the plain secret to a later task (checked on the mock's /echo) ✅ ✅ ✅ ✅
Get / List outputs contain no secret ✅ ✅ ✅ ✅

Without the key, Kestra's own fallback stores the value as is and logs the warning, as the PR description says (already raised in the first review as a residual point for maintainers; not a new finding).

Output shape in the UI (Create.Output extends KeyOutput)

  • Plugin docs page, both versions: Create outputs list exactly accessKey, createdAt, grants, name, secretKey (1.3.42, 2.0.5). The new Spaces Keys (4) subgroup shows Create, Delete, Get, List.
  • Execution outputs: same five keys at runtime on both versions; Get has the four KeyOutput keys only. On 1.3.42 the UI renders the type string of the encrypted value as an "External link" label (Kestra UI display, same for any EncryptedString).
  • Flows validate in the editor on both versions (1.3.42, 2.0.5).

Summary

# Flow Scenario 1.3.42 2.0.5
1 digitalocean_create_spaces_key Create @example (new) ✅ SUCCESS ✅ SUCCESS
2 digitalocean_get_spaces_key Get @example (new) ✅ SUCCESS ✅ SUCCESS
3 digitalocean_list_spaces_keys List @example (new) ✅ SUCCESS ✅ SUCCESS
4 digitalocean_delete_spaces_key Delete @example (new) ✅ SUCCESS ✅ SUCCESS
5 qa_rotate_key Create, Get, List, use the secret downstream, revoke (new) ✅ SUCCESS ✅ SUCCESS
6 qa_create_fullaccess single FULLACCESS grant, no bucket (new) ✅ SUCCESS ✅ SUCCESS
7 qa_create_no_grants no grants (new) ✅ SUCCESS ✅ SUCCESS
8 qa_create_mixed_grants FULLACCESS + READ (negative) (new) ✅ FAILED as expected ✅ FAILED as expected
9 qa_create_scoped_no_bucket READWRITE without bucket (negative) (new) ✅ FAILED as expected ✅ FAILED as expected
10 qa_create_pebble name and grants from inputs (STRING + JSON), List by name with FETCH_ONE (new) ✅ SUCCESS ✅ SUCCESS
11 qa_list_paged_store pagination (perPage: 2), fetchType: STORE and NONE (new) ✅ SUCCESS ✅ SUCCESS
12 qa_get_not_found Get on an unknown key (negative) (new) ✅ FAILED as expected ✅ FAILED as expected
13 qa_delete_not_found Delete on an unknown key (negative) (new) ✅ FAILED as expected ✅ FAILED as expected
14 qa_create_rate_limited Create answered with HTTP 429 (negative) (new) ✅ FAILED as expected ✅ FAILED as expected
15 qa_billing_nonregression non-regression: billing.GetBalance ✅ SUCCESS ✅ SUCCESS

Flow 1: digitalocean_create_spaces_key (✅ SUCCESS)

Flow YAML
id: digitalocean_create_spaces_key
namespace: company.team

tasks:
  - id: create_key
    type: io.kestra.plugin.digitalocean.spaces.key.Create
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    name: reports-reader
    grants:
      - bucket: reports
        permission: READ
  - id: log_key
    type: io.kestra.plugin.core.log.Log
    message: "Created access key {{ outputs.create_key.accessKey }}"

Gantt (key set)

Task 1.3.42 2.0.5
create_key SUCCESS 0.07s SUCCESS 0.06s
log_key SUCCESS 0.04s SUCCESS 0.03s

Logs synthesis: Creating DigitalOcean Spaces access key 'reports-reader' with 1 grant(s), then Created access key DO00…. No warning when the key is set.

Outputs synthesis: name, accessKey, grants: [{bucket: reports, permission: read}], createdAt, and secretKey: {value: <AES ciphertext>, type: io.kestra.datatype:aes_encrypted}. Request body: {"name":"reports-reader","grants":[{"bucket":"reports","permission":"read"}]}.

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 logs · v2.0.5 logs · v1.3.42 outputs · v2.0.5 outputs

Flow 2: digitalocean_get_spaces_key (✅ SUCCESS)

Flow YAML
id: digitalocean_get_spaces_key
namespace: company.team

tasks:
  - id: get_key
    type: io.kestra.plugin.digitalocean.spaces.key.Get
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    accessKey: DO00EXAMPLEACCESSKEY
  - id: log_grants
    type: io.kestra.plugin.core.log.Log
    message: "Key {{ outputs.get_key.name }} has grants {{ outputs.get_key.grants }}"

Gantt (key set)

Task 1.3.42 2.0.5
get_key SUCCESS 0.87s SUCCESS 0.65s
log_grants SUCCESS 0.03s SUCCESS 0.08s

Logs synthesis: Fetching DigitalOcean Spaces access key DO00EXAMPLEACCESSKEY.

Outputs synthesis: name: reports-writer, accessKey, grants: [{bucket: reports, permission: readwrite}], createdAt. No secretKey key.

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 outputs · v2.0.5 outputs

Flow 3: digitalocean_list_spaces_keys (✅ SUCCESS)

Flow YAML
id: digitalocean_list_spaces_keys
namespace: company.team

tasks:
  - id: list_keys
    type: io.kestra.plugin.digitalocean.spaces.key.List
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    bucket: reports
    permission: READWRITE
  - id: log_total
    type: io.kestra.plugin.core.log.Log
    message: "{{ outputs.list_keys.total }} key(s) can write to the reports bucket"

Gantt (key set)

Task 1.3.42 2.0.5
list_keys SUCCESS 0.06s SUCCESS 0.61s
log_total SUCCESS 0.05s SUCCESS 0.08s

Logs synthesis: 1 key(s) can write to the reports bucket.

Outputs synthesis: rows (1 key), size: 1, total: 1. Query sent: ?bucket=reports&permission=readwrite&per_page=200 (permission lowercased).

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 logs · v2.0.5 logs · v1.3.42 outputs · v2.0.5 outputs

Flow 4: digitalocean_delete_spaces_key (✅ SUCCESS)

Flow YAML
id: digitalocean_delete_spaces_key
namespace: company.team

tasks:
  - id: delete_key
    type: io.kestra.plugin.digitalocean.spaces.key.Delete
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    accessKey: DO00EXAMPLEACCESSKEY

Gantt (key set)

Task 1.3.42 2.0.5
delete_key SUCCESS 0.05s SUCCESS 0.03s

Logs synthesis: Deleting DigitalOcean Spaces access key DO00EXAMPLEACCESSKEY; the mock received DELETE /v2/spaces/keys/DO00EXAMPLEACCESSKEY and answered 204.

Outputs synthesis: No outputs (VoidOutput).

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 logs · v2.0.5 logs

Flow 5: qa_rotate_key (✅ SUCCESS)

Flow YAML
id: qa_rotate_key
namespace: qa.digitalocean

tasks:
  - id: create_key
    type: io.kestra.plugin.digitalocean.spaces.key.Create
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    name: job-reports-reader
    grants:
      - bucket: reports
        permission: READ
      - bucket: logs
        permission: READWRITE
  - id: get_key
    type: io.kestra.plugin.digitalocean.spaces.key.Get
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    accessKey: "{{ outputs.create_key.accessKey }}"
  - id: list_bucket_keys
    type: io.kestra.plugin.digitalocean.spaces.key.List
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    bucket: reports
  - id: use_secret
    type: io.kestra.plugin.core.http.Request
    uri: http://qa-digitalocean25-mock:8080/echo
    method: POST
    contentType: application/json
    body: '{"accessKey": "{{ outputs.create_key.accessKey }}", "secretKey": "{{ outputs.create_key.secretKey }}"}'
  - id: revoke_key
    type: io.kestra.plugin.digitalocean.spaces.key.Delete
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    accessKey: "{{ outputs.create_key.accessKey }}"
  - id: summary
    type: io.kestra.plugin.core.log.Log
    message: "Created {{ outputs.get_key.name }} ({{ outputs.create_key.accessKey }}) with {{ outputs.get_key.grants | length }} grant(s); {{ outputs.list_bucket_keys.total }} key(s) on reports; secretKey output type: {{ outputs.create_key.secretKey.type ?? 'n/a' }}"

Gantt (key set)

Task 1.3.42 2.0.5
create_key SUCCESS 0.07s SUCCESS 0.04s
get_key SUCCESS 0.04s SUCCESS 0.05s
list_bucket_keys SUCCESS 0.03s SUCCESS 0.04s
use_secret SUCCESS 0.08s SUCCESS 0.06s
revoke_key SUCCESS 0.05s SUCCESS 0.04s
summary SUCCESS 0.03s SUCCESS 0.04s

Logs synthesis: Created job-reports-reader (DO00…) with 2 grant(s); 5 key(s) on reports; secretKey output type: n/a. The n/a shows that {{ outputs.create_key.secretKey }} renders as a plain string downstream.

Outputs synthesis: The /echo endpoint of the mock received exactly the secret it had issued for this key, through {{ outputs.create_key.secretKey }} in an HTTP Request body. Get returns the same two grants; Delete revoked the created key.

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 logs · v2.0.5 logs · v1.3.42 outputs · v2.0.5 outputs

Flow 6: qa_create_fullaccess (✅ SUCCESS)

Flow YAML
id: qa_create_fullaccess
namespace: qa.digitalocean

tasks:
  - id: create_key
    type: io.kestra.plugin.digitalocean.spaces.key.Create
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    name: qa-admin
    grants:
      - permission: FULLACCESS

Gantt (key set)

Task 1.3.42 2.0.5
create_key SUCCESS 0.07s SUCCESS 0.04s

Logs synthesis: One INFO line, no warning.

Outputs synthesis: Request body grant: {"bucket":"","permission":"fullaccess"} (empty bucket, as the API expects). Output grants: [{bucket: "", permission: fullaccess}], secretKey encrypted.

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 outputs · v2.0.5 outputs

Flow 7: qa_create_no_grants (✅ SUCCESS)

Flow YAML
id: qa_create_no_grants
namespace: qa.digitalocean

tasks:
  - id: create_key
    type: io.kestra.plugin.digitalocean.spaces.key.Create
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    name: qa-no-access

Gantt (key set)

Task 1.3.42 2.0.5
create_key SUCCESS 0.04s SUCCESS 0.04s

Logs synthesis: One INFO line.

Outputs synthesis: Request body {"name":"qa-no-access","grants":[]}; output grants: [], secretKey encrypted.

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 outputs · v2.0.5 outputs

Flow 8: qa_create_mixed_grants (✅ FAILED as expected)

Flow YAML
id: qa_create_mixed_grants
namespace: qa.digitalocean

tasks:
  - id: create_key
    type: io.kestra.plugin.digitalocean.spaces.key.Create
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    name: qa-mixed
    grants:
      - permission: FULLACCESS
      - bucket: reports
        permission: READ

Gantt (key set)

Task 1.3.42 2.0.5
create_key FAILED 0.06s FAILED 0.05s

Logs synthesis: ERROR FULLACCESS cannot be combined with bucket-scoped grants: use a single FULLACCESS grant, or only READ/READWRITE grants.

Outputs synthesis: No request reached the mock.

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 logs · v2.0.5 logs

Flow 9: qa_create_scoped_no_bucket (✅ FAILED as expected)

Flow YAML
id: qa_create_scoped_no_bucket
namespace: qa.digitalocean

tasks:
  - id: create_key
    type: io.kestra.plugin.digitalocean.spaces.key.Create
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    name: qa-no-bucket
    grants:
      - permission: READWRITE

Gantt (key set)

Task 1.3.42 2.0.5
create_key FAILED 0.03s FAILED 0.04s

Logs synthesis: ERROR A READWRITE grant needs a bucket name.

Outputs synthesis: No request reached the mock.

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 logs · v2.0.5 logs

Flow 10: qa_create_pebble (✅ SUCCESS)

Flow YAML
id: qa_create_pebble
namespace: qa.digitalocean

inputs:
  - id: key_name
    type: STRING
    defaults: qa-pebble-key
  - id: grants
    type: JSON
    defaults: '[{"bucket": "reports", "permission": "READ"}, {"bucket": "archive", "permission": "READWRITE"}]'

tasks:
  - id: create_key
    type: io.kestra.plugin.digitalocean.spaces.key.Create
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    name: "{{ inputs.key_name }}"
    grants: "{{ inputs.grants }}"
  - id: list_by_name
    type: io.kestra.plugin.digitalocean.spaces.key.List
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    name: "{{ inputs.key_name }}"
    fetchType: FETCH_ONE

Gantt (key set)

Task 1.3.42 2.0.5
create_key SUCCESS 0.04s SUCCESS 0.05s
list_by_name SUCCESS 0.03s SUCCESS 0.04s

Logs synthesis: INFO lines only.

Outputs synthesis: Grants rendered from the JSON input and sent as [{reports, read}, {archive, readwrite}]. list_by_name sent ?name=qa-pebble-key and returned row with the new key, size: 1, total: 1.

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 outputs · v2.0.5 outputs

Flow 11: qa_list_paged_store (✅ SUCCESS)

Flow YAML
id: qa_list_paged_store
namespace: qa.digitalocean

tasks:
  - id: list_store
    type: io.kestra.plugin.digitalocean.spaces.key.List
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    perPage: 2
    fetchType: STORE
  - id: list_none
    type: io.kestra.plugin.digitalocean.spaces.key.List
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    permission: READ
    fetchType: NONE
  - id: read_store
    type: io.kestra.plugin.core.log.Log
    message: "STORE total={{ outputs.list_store.total }} NONE(permission=read) total={{ outputs.list_none.total }} uri={{ outputs.list_store.uri }}"

Gantt (key set)

Task 1.3.42 2.0.5
list_store SUCCESS 0.09s SUCCESS 0.09s
list_none SUCCESS 0.06s SUCCESS 0.04s
read_store SUCCESS 0.04s SUCCESS 0.03s

Logs synthesis: STORE total=8 NONE(permission=read) total=4 uri=kestra:///…ion.

Outputs synthesis: 4 pages followed through links.pages.next (?per_page=2, then page=2..4). The STORE file (1.1 KiB Ion) is listed on both versions, and on 2.0.5 its preview renders all 8 rows from the binary Ion. list_none returned only the count.

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 logs · v2.0.5 logs · v1.3.42 outputs · v2.0.5 outputs

Flow 12: qa_get_not_found (✅ FAILED as expected)

Flow YAML
id: qa_get_not_found
namespace: qa.digitalocean

tasks:
  - id: get_key
    type: io.kestra.plugin.digitalocean.spaces.key.Get
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    accessKey: DO00DOESNOTEXIST

Gantt (key set)

Task 1.3.42 2.0.5
get_key FAILED 0.05s FAILED 0.06s

Logs synthesis: ERROR DigitalOcean API returned HTTP 404: resource not found. Verify baseUrl … The resource you were accessing could not be found.

Outputs synthesis: None.

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 logs · v2.0.5 logs

Flow 13: qa_delete_not_found (✅ FAILED as expected)

Flow YAML
id: qa_delete_not_found
namespace: qa.digitalocean

tasks:
  - id: delete_key
    type: io.kestra.plugin.digitalocean.spaces.key.Delete
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    accessKey: DO00DOESNOTEXIST

Gantt (key set)

Task 1.3.42 2.0.5
delete_key FAILED 0.04s FAILED 0.05s

Logs synthesis: Same 404 message as above.

Outputs synthesis: None.

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 logs · v2.0.5 logs

Flow 14: qa_create_rate_limited (✅ FAILED as expected)

Flow YAML
id: qa_create_rate_limited
namespace: qa.digitalocean

tasks:
  - id: create_key
    type: io.kestra.plugin.digitalocean.spaces.key.Create
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
    name: rate-limited
    grants:
      - bucket: reports
        permission: READ

Gantt (key set)

Task 1.3.42 2.0.5
create_key FAILED 1.05s FAILED 1.04s

Logs synthesis: ERROR DigitalOcean API rate limit hit (HTTP 429). Honor the retry-after response header before retrying. API Rate limit exceeded.

Outputs synthesis: None. The mock saw the POST twice (one retry about 1 s apart) before the task failed; harmless on a 429 since no key is created.

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 logs · v2.0.5 logs

Flow 15: qa_billing_nonregression (✅ SUCCESS)

Flow YAML
id: qa_billing_nonregression
namespace: qa.digitalocean

tasks:
  - id: balance
    type: io.kestra.plugin.digitalocean.billing.GetBalance
    apiToken: "{{ secret('DIGITALOCEAN_TOKEN') }}"
    baseUrl: http://qa-digitalocean25-mock:8080
  - id: log_status
    type: io.kestra.plugin.core.log.Log
    message: "Balance {{ outputs.balance }}"

Gantt (key set)

Task 1.3.42 2.0.5
balance SUCCESS 0.03s SUCCESS 0.05s
log_status SUCCESS 0.03s SUCCESS 0.03s

Logs synthesis: Balance {…monthToDateBalance:23.44, accountBalance:12.23…}.

Outputs synthesis: monthToDateBalance: 23.44, accountBalance: 12.23, monthToDateUsage: 11.21, generatedAt.

Screenshots: v1.3.42 gantt · v2.0.5 gantt · v1.3.42 outputs · v2.0.5 outputs

Key unset runs

Flows 1, 5 and 6 were run again on both versions without the encryption key: all SUCCESS, with the WARN lines above (1.3.42 logs, 2.0.5 logs). Downstream tasks then log Unable to decrypt the output as encryption is not configured and still get the plain value.

Observations (not caused by this PR)

  • 🟢 With fetchType: STORE, size is 0 while 8 rows are stored (total: 8). This comes from the shared toPageOutput in AbstractDigitalOceanTask, unchanged here, so every List task in the plugin behaves the same.
  • 🟢 List rows keep the API's snake_case keys (access_key, created_at) while Get/Create expose camelCase (accessKey, createdAt). This matches the other List tasks of the plugin.

Timeouts

None. Every execution finished within 2 s. The first execution right after a 2.0.5 boot answered 504 to the API call that created it, but the execution itself ran and succeeded.

# Conflicts:
#	AGENTS.md
#	README.md
#	src/main/resources/doc/io.kestra.plugin.digitalocean.md
#	src/main/resources/metadata/index.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/plugin Plugin-related issue or feature request kind/external Pull requests raised by community contributors

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

DigitalOcean: add Spaces access key tasks (part of #10)

4 participants