Skip to content

Add NGTS configuration + NGTS client#788

Merged
SgtCoDFish merged 2 commits intomasterfrom
ngts-flags
Apr 8, 2026
Merged

Add NGTS configuration + NGTS client#788
SgtCoDFish merged 2 commits intomasterfrom
ngts-flags

Conversation

@SgtCoDFish
Copy link
Copy Markdown
Contributor

@SgtCoDFish SgtCoDFish commented Mar 24, 2026

This will add initial support for NGTS. Auth is based on the existing Venafi Cloud client using a keypair.

I'm not really able to test this effectively because of various issues with the test env, but I think this is safe enough to merge as-is because it's not customer-facing yet (needs helm chart support before this is realistically usable)

Note there are several TODOs in this PR. They need to be clarified before we can expose this functionality to customers, but I think they're fine for now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

NB: this is pretty much copy+pasted from client_venafi_cloud.go because the logic is nearly identical. I refactored some of the shared logic out (util.go) but mostly this is the same thing with different names

claims["iss"] = c.credentials.ClientID
claims["iat"] = time.Now().Unix()
claims["exp"] = time.Now().Add(time.Minute).Unix()
claims["aud"] = path.Join(c.baseURL.Host, ngtsAccessTokenEndpoint)
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.

I think the NGTS endpoint has not been updated yet to accept anything other than "api.venafi.cloud/v1/oauth/token/serviceaccount" here?

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.

Is this working for the NGTS endpoint?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the heads up - this was a guess and was untested (because none of this code is usable, testing is kinda 🤷 - this is just a first step to make future reviews smaller).

I've used the old aud for now. I'm working to test locally in a branch with helm changes

Spotted by @George-Yanev

Signed-off-by: Ashley Davis <ashley.davis@cyberark.com>
This will add initial support for NGTS. Auth is based on the existing
Venafi Cloud client using a keypair.

Signed-off-by: Ashley Davis <ashley.davis@cyberark.com>
Comment on lines +256 to +260
c.lock.RLock()
needsUpdate := c.accessToken == nil || time.Now().Add(time.Minute).After(c.accessToken.expirationTime)
c.lock.RUnlock()

if needsUpdate {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

note: @George-Yanev spotted that the locks weren't handled properly in the NGTS client, which is copied from here. So I fixed it here too.

@SgtCoDFish
Copy link
Copy Markdown
Contributor Author

@George-Yanev gave this a thumbs up in slack, so I'll merge now to be able to get the helm chart PR raised + reviewable.

@SgtCoDFish SgtCoDFish merged commit 890763f into master Apr 8, 2026
4 checks passed
@SgtCoDFish SgtCoDFish deleted the ngts-flags branch April 8, 2026 11:09
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.

4 participants