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 scaffolding as well as implementation for rotation_handler #1

Merged
merged 9 commits into from
Apr 19, 2022

Conversation

raserva
Copy link
Contributor

@raserva raserva commented Apr 15, 2022

This is starting to get large, so i thought this was a good time to pause and set up a PR for what i had done so far. The config class is very much TODO at the moment, just the interface set up for the most part. The rotation_handler class is the meat of this PR

Copy link
Contributor

@yolocs yolocs left a comment

Choose a reason for hiding this comment

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

Will take another detailed look

services/go/cmd/cert-rotation/main.go Outdated Show resolved Hide resolved
services/go/apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
services/go/apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
services/go/apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
services/go/cmd/cert-rotation/main.go Outdated Show resolved Hide resolved
services/go/cmd/cert-rotation/main.go Outdated Show resolved Hide resolved
// Example:
// `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`
// -> `projects/*/locations/*/keyRings/*/cryptoKeys/*`
func getKeyNameFromVersion(keyVersionName string) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be proto helpers for this already I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

services/go/pkg/crypto/rotation_handler_test.go Outdated Show resolved Hide resolved
services/go/pkg/crypto/rotation_handler_test.go Outdated Show resolved Hide resolved
services/go/pkg/crypto/rotation_handler_test.go Outdated Show resolved Hide resolved
services/go/pkg/crypto/rotation_handler_test.go Outdated Show resolved Hide resolved
services/go/apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
services/go/apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
services/go/apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
services/go/cmd/cert-rotation/main.go Outdated Show resolved Hide resolved
services/go/cmd/cert-rotation/main.go Outdated Show resolved Hide resolved
services/go/pkg/crypto/rotation_handler.go Outdated Show resolved Hide resolved
services/go/pkg/crypto/rotation_handler.go Outdated Show resolved Hide resolved
services/go/pkg/crypto/rotation_handler_test.go Outdated Show resolved Hide resolved
services/go/pkg/crypto/rotation_handler_test.go Outdated Show resolved Hide resolved
services/go/pkg/crypto/rotation_handler_test.go Outdated Show resolved Hide resolved
services/go/apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
services/go/apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
services/go/apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
@raserva raserva marked this pull request as draft April 18, 2022 19:23
This was referenced Apr 18, 2022
@raserva raserva marked this pull request as ready for review April 18, 2022 21:45
@raserva raserva requested review from a team, crwilcox and myurtoglu and removed request for a team April 18, 2022 21:45
apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
pkg/crypto/rotation_handler.go Outdated Show resolved Hide resolved
pkg/crypto/rotation_handler.go Outdated Show resolved Hide resolved
scripts/format_go.sh Outdated Show resolved Hide resolved
// See the License for the specific language governing permissions and
// limitations under the License.

package v1alpha1

Choose a reason for hiding this comment

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

it seems odd to me to include an empty test and that this could give a false sense that we are testing?

Copy link
Contributor Author

@raserva raserva Apr 18, 2022

Choose a reason for hiding this comment

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

I put it here in order to make it clear that this is intentionally TODO, as if there was no test file, it could just be an omission.

apis/v1alpha1/crypto_config.go Outdated Show resolved Hide resolved
}
defer kmsClient.Close()

// TODO: Set up server with mux. https://github.com/abcxyz/jvs/issues/8
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip: a simpler way is to "TODO(#8)"

go.iml Outdated Show resolved Hide resolved
pkg/crypto/rotation_handler.go Outdated Show resolved Hide resolved
@raserva
Copy link
Contributor Author

raserva commented Apr 19, 2022

test

@sethvargo sethvargo deleted the rsrv-crypto branch April 19, 2022 23:22
sqin2019 pushed a commit that referenced this pull request Apr 6, 2023
feat: Add scaffolding as well as implementation for rotation_handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants