Skip to content

james/dt4a auth #2149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Mar 18, 2025
Merged

james/dt4a auth #2149

merged 29 commits into from
Mar 18, 2025

Conversation

James-Pickett
Copy link
Contributor

@James-Pickett James-Pickett commented Mar 13, 2025

adds chain of trust / NaCl auth middleware to dt4a endpoint

relates to https://github.com/kolide/k2/issues/11530

@James-Pickett James-Pickett changed the title james/zta auth james/dt4a auth Mar 13, 2025
// In the future, we will want to make this authenticated; for now, it is not authenticated.
mux.Handle("/zta", ls.requestZtaInfoHandler())
mux.Handle("/zta", ztaAuthMiddleware.Wrap(ls.requestZtaInfoHandler()))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

rename endpoint to dt4a

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm afraid this review will get really gnarly if I rename all the zta references to dt4a, so I want to wait until after this merges

Copy link
Contributor

@RebeccaMahany RebeccaMahany left a comment

Choose a reason for hiding this comment

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

Tests look great and really thorough!

@James-Pickett James-Pickett marked this pull request as ready for review March 17, 2025 16:51
RebeccaMahany
RebeccaMahany previously approved these changes Mar 17, 2025
Copy link
Contributor

@RebeccaMahany RebeccaMahany left a comment

Choose a reason for hiding this comment

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

LGTM, nice work!

RebeccaMahany
RebeccaMahany previously approved these changes Mar 17, 2025
zackattack01
zackattack01 previously approved these changes Mar 17, 2025
Copy link
Contributor

@zackattack01 zackattack01 left a comment

Choose a reason for hiding this comment

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

nice! great docs/comments throughout 🔥

mux.Handle("/zta", ls.requestZtaInfoHandler())

// mux.Handle("/zta", ztaAuthMiddleware.Wrap(ls.requestZtaInfoHandler()))
mux.Handle("/v0/dt4a", ztaAuthMiddleware.Wrap(ls.requestZtaInfoHandler()))
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be on /v0 or /v1 unless it's in ecKryptoMiddleware.

Could be /dt4a or /dt4a/v0

I guess we could also call it /v3/dt4a but my hunch is that we're not going to bring more into this api. Or if we do, it might be dt4a/app-list

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe /v3/dt4a and then /v3/app-list (if needed) is growing on me 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea, it grew on me too, updated to /v3/dt4a

"encoding/json"
"fmt"

"github.com/lestrrat-go/jwx/jwk"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to pull in this library? It feels a little sprawling, and I feel very -_- about third parties these days

Copy link
Contributor Author

@James-Pickett James-Pickett Mar 18, 2025

Choose a reason for hiding this comment

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

yea, it had quite a few dependencies, I dropped it and now just using std lib. More code to handle key conversions, but once separated, makes core logic code simpler. Updated

RebeccaMahany
RebeccaMahany previously approved these changes Mar 18, 2025
Copy link
Contributor

@RebeccaMahany RebeccaMahany left a comment

Choose a reason for hiding this comment

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

🔥

@James-Pickett James-Pickett added this pull request to the merge queue Mar 18, 2025
Merged via the queue into kolide:main with commit c9d46d4 Mar 18, 2025
32 checks passed
@James-Pickett James-Pickett deleted the james/zta-auth branch March 18, 2025 16:59
@RebeccaMahany RebeccaMahany added the features-improvements Features and Improvements label Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
features-improvements Features and Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants