Skip to content
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

feat: Add validation token endpoint #487

Merged
merged 4 commits into from
Jan 16, 2025

Conversation

bgins
Copy link
Contributor

@bgins bgins commented Jan 15, 2025

Summary

This pull request makes the following changes:

  • Add solver validation token secret and expiration options
  • Add solver validation token endpoint
  • Add client validation token helper

We are adding a validation token endpoint to support our upcoming validation service.

Task/Issue reference

Closes: #486

Test plan

We have included a temporary commit (be58e61) to show a client request for a token. This temporary commit will be removed before merging this pull request.

Details

We have added SERVER_VALIDATION_TOKEN_SECRET and SERVER_VALIDATION_TOKEN_EXPIRATION solver server options. SERVER_VALIDATION_TOKEN_SECRET is required and does not have a default value. SERVER_VALIDATION_TOKEN_EXPIRATION defaults to a one week, but can be configured to another value in seconds.

The options can be configured through environment variables or CLI options:

./stack solver --server-validation-token-expiration 500
SERVER_VALIDATION_TOKEN_EXPIRATION=500 ./stack solver
./stack solver --server-validation-token-secret somesecret
SERVER_VALIDATION_TOKEN_SECRET=somesecret ./stack solver

Note that the SERVER_VALIDATION_TOKEN_SECRET is overridden by the key we have generated for local development:

lilypad/stack

Line 204 in be58e61

export SERVER_VALIDATION_TOKEN_SECRET=912dd001a6613632c066ca10a19254430db2986a84612882a18f838a6360880e

Comment this line to test.

Related issues or PRs

Epic: https://www.notion.so/lilypadnetwork/MVP-Validation-176155da99b5801ebeffc417f6b270c7

@bgins bgins force-pushed the bgins/feat-add-validation-token-endpoint branch from be58e61 to 680f3d7 Compare January 15, 2025 17:54
@bgins bgins marked this pull request as ready for review January 15, 2025 17:55
@bgins bgins requested a review from a team as a code owner January 15, 2025 17:55
@bgins bgins self-assigned this Jan 15, 2025
Copy link
Contributor

@hollygrimm hollygrimm left a comment

Choose a reason for hiding this comment

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

I'd like to modify the value of sub, please see the specific comment for details.

pkg/solver/server.go Outdated Show resolved Hide resolved
@bgins bgins force-pushed the bgins/feat-add-validation-token-endpoint branch from 680f3d7 to a55afb2 Compare January 15, 2025 19:07
@bgins bgins force-pushed the bgins/feat-add-validation-token-endpoint branch from a55afb2 to 1965de1 Compare January 15, 2025 19:24
@bgins bgins merged commit fe37ec6 into main Jan 16, 2025
4 checks passed
@bgins bgins deleted the bgins/feat-add-validation-token-endpoint branch January 16, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add validation token endpoint
2 participants