-
Notifications
You must be signed in to change notification settings - Fork 560
Add support for minting WIT-SVIDs #6517
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
base: main
Are you sure you want to change the base?
Conversation
aef8c43 to
aa9d8cb
Compare
Signed-off-by: Sorin Dumitru <sorin@returnze.ro>
Signed-off-by: Sorin Dumitru <sorin@returnze.ro>
Signed-off-by: Sorin Dumitru <sorin@returnze.ro>
Signed-off-by: Sorin Dumitru <sorin@returnze.ro>
Signed-off-by: Sorin Dumitru <sorin@returnze.ro>
pkg/server/api/svid/v1/service.go
Outdated
| PublicKey: jose.JSONWebKey{ | ||
| Key: publicKey, | ||
| }, | ||
| // TODO: add its own TTL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to mention https://github.com/spiffe/go-spiffe/issues/373 here.
|
|
||
| for format in pretty json; do | ||
| for keyType in ec-p256 ec-p384 rsa-2048 rsa-4096; do | ||
| docker compose exec -T spire-server /opt//spire/bin/spire-server \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| docker compose exec -T spire-server /opt//spire/bin/spire-server \ | |
| docker compose exec -T spire-server /opt/spire/bin/spire-server \ |
| done | ||
|
|
||
| # Check that we can specify a custom TTL | ||
| docker compose exec -T spire-server /opt//spire/bin/spire-server \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| docker compose exec -T spire-server /opt//spire/bin/spire-server \ | |
| docker compose exec -T spire-server /opt/spire/bin/spire-server \ |
| wit mint -spiffeID "spiffe://domain.test/workload" -ttl 60s || fail-now "could not mint WIT-SVID with custom TTL" | ||
|
|
||
| # Check that WIT-SVID can be written to a directory | ||
| docker compose exec -T spire-server /opt//spire/bin/spire-server \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| docker compose exec -T spire-server /opt//spire/bin/spire-server \ | |
| docker compose exec -T spire-server /opt/spire/bin/spire-server \ |
cmd/spire-server/cli/cli.go
Outdated
| "jwt mint": func() (cli.Command, error) { | ||
| return jwt.NewMintCommand(), nil | ||
| }, | ||
| "wit mint": func() (cli.Command, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should only expose wit commands if the feature flag is enabled.
It's unfortunate that we can't use the fflag package at this point, because fflags are not loaded until we load the config in Run.
You can refer to https://github.com/spiffe/spire/pull/5586/changes#diff-f06b238782ee9be14f22b6719b32075f5a2ec8c96fe6d2fd4885e74326d98d05L146 for an example of how we implemented this when we had the force rotation work in progress. We should probably have a better solution for this.
Signed-off-by: Sorin Dumitru <sorin@returnze.ro>
Description of change
This adds support in spire-server for minting WIT-SVIDs using the MintWITSVID API. The BatchNewWITSVID APIs are also implemented, but are currently unused.
Which issue this PR fixes
fixes #6374