crossplane-contrib / provider-argocd

Crossplane provider to provision and manage Argo CD objects
Apache License 2.0
68 stars 35 forks source link

Add token generation #188

Open clementblaise opened 1 month ago

clementblaise commented 1 month ago

Description of your changes

Fixes #187

The PR adds ProjectToken to configure tokens and how they should be renewed. It extends the ArgoCD Project client so that the controller can issue tokens. The controller has been updated to add the necessary logic to create and update tokens while saving them as Secret.

I am unsure how to deal with the existing JWTTokens on ProjectRole.

I have:

How has this code been tested

Tested on a local cluster with a deployment of ArgoCD. Added unit tests

MisterMX commented 1 month ago

I think it is better to implement ProjectToken as a seperate resource instead of including it in Project.

clementblaise commented 1 month ago

Hey @MisterMX, is there any reason you think it's a better implementation to have a ProjectToken resource?

I had thought about it but didn't like:

MisterMX commented 1 month ago

I would consider a token its own entity with its own lifecycle. It should be possible to create tokens independently from the project. I would therefor see it as a separate resource.

Can you explain why a breaking change in the project status is necessary?