Skip to content

add support write only arguments for resources robot_account and user#573

Merged
flbla merged 3 commits intogoharbor:mainfrom
defimenko-ops:write-only-arguments
Feb 27, 2026
Merged

add support write only arguments for resources robot_account and user#573
flbla merged 3 commits intogoharbor:mainfrom
defimenko-ops:write-only-arguments

Conversation

@defimenko-ops
Copy link
Contributor

Summary

  • Add write-only credential arguments for harbor_user and harbor_robot_account.
  • Implement rotation triggers with password_wo_version and secret_wo_version.
  • Add validation rules, tests updates for the new workflow.

Details

  • harbor_user:
    • add password_wo (write-only)
    • add password_wo_version
    • keep backward compatibility for password
    • add warning to prefer write-only alternative when possible
  • harbor_robot_account:
    • add secret_wo (write-only)
    • add secret_wo_version
    • keep backward compatibility for secret
    • add warning to prefer write-only alternative when possible
  • enforce schema constraints for valid combinations (RequiredWith/ConflictsWith)
  • handle failed password/secret update paths without leaving stale values in state

Verification

  • Unit tests:
    • go test ./provider ./client
  • Acceptance tests (targeted):
    • TestAccUserWriteOnlyPassword
    • TestAccRobotProjectWriteOnlySecret
  • Manual e2e check against Harbor in kind:
    • password_wo/secret_wo used successfully
    • cleartext secret values are not persisted in Terraform state

Closes #572

@defimenko-ops defimenko-ops requested a review from a team as a code owner February 24, 2026 12:04
Signed-off-by: defimenko-ops <defimenko000@gmail.com>
@defimenko-ops
Copy link
Contributor Author

Hi, @flbla
Can someone review this change?

@flbla
Copy link
Contributor

flbla commented Feb 24, 2026

hi @defimenko-ops,
can you update the documentation ?

Signed-off-by: defimenko-ops <defimenko000@gmail.com>
@defimenko-ops
Copy link
Contributor Author

hi @defimenko-ops, can you update the documentation ?
@flbla
all ready!

@defimenko-ops
Copy link
Contributor Author

Hi, @flbla !
What can I do to ensure my PR is approved?

@flbla
Copy link
Contributor

flbla commented Feb 27, 2026

hi @defimenko-ops,
please be patient, I do code reviews in my free time
it will be done, don't worry

Copy link
Contributor

@flbla flbla left a comment

Choose a reason for hiding this comment

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

LGTM

@flbla flbla merged commit 9d6caee into goharbor:main Feb 27, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add write-only credential arguments for harbor_user and harbor_robot_account

2 participants