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: adding implementation for client lib #36

Merged
merged 102 commits into from
May 26, 2022
Merged

feat: adding implementation for client lib #36

merged 102 commits into from
May 26, 2022

Conversation

raserva
Copy link
Contributor

@raserva raserva commented May 23, 2022

Few things to note:

The environment config library does not gracefully handle overwrite and default flags set. In this library, you pass in an existing object (originally set using YAML in this code), and if "overwrite" is set, then existing values are overwritten if env vars are set. There is also functionality to specify a default if no env var is set. Right now, if default and overwrite is set, existing (YAML) values will always be overwritten. Therefore, the precedence (if using the library) is env vars > default > yaml. However, i would like env vars > yaml > default, and must set it manually through code.

Currently, the core JVS implementations use a different library for JWT creation & signing. Here is another PR that does the necessary changes server-side: #37

@raserva raserva marked this pull request as draft May 24, 2022 17:05
@raserva raserva changed the title feat: adding implementation for client lib !! DO NOT REVIEW - RE WRITING !! feat: adding implementation for client lib May 24, 2022
@raserva raserva marked this pull request as ready for review May 24, 2022 22:19
@raserva raserva changed the title !! DO NOT REVIEW - RE WRITING !! feat: adding implementation for client lib feat: adding implementation for client lib May 24, 2022
@raserva
Copy link
Contributor Author

raserva commented May 25, 2022

This should be ready for another pass, whenever people have time

yolocs
yolocs previously requested changes May 25, 2022
client-lib/go/client/jvs_client.go Outdated Show resolved Hide resolved
client-lib/go/client/jvs_client_test.go Outdated Show resolved Hide resolved
client-lib/go/client/jvs_client_test.go Outdated Show resolved Hide resolved
client-lib/go/client/jvs_client_test.go Outdated Show resolved Hide resolved
client-lib/go/client/jvs_client_test.go Outdated Show resolved Hide resolved
client-lib/go/client/jvs_client_test.go Outdated Show resolved Hide resolved
client-lib/go/client/jvs_client_test.go Outdated Show resolved Hide resolved
client-lib/go/client/jvs_client_test.go Outdated Show resolved Hide resolved
client-lib/go/client/jvs_client_test.go Outdated Show resolved Hide resolved
pkg/jvscrypto/key_hosting.go Show resolved Hide resolved
raserva and others added 10 commits May 25, 2022 14:32
Co-authored-by: cshou <cshou@google.com>
Co-authored-by: cshou <cshou@google.com>
Co-authored-by: cshou <cshou@google.com>
Co-authored-by: cshou <cshou@google.com>
Co-authored-by: cshou <cshou@google.com>
Co-authored-by: cshou <cshou@google.com>
Co-authored-by: cshou <cshou@google.com>
Co-authored-by: cshou <cshou@google.com>
Co-authored-by: cshou <cshou@google.com>
client-lib/go/go.mod Show resolved Hide resolved
@raserva raserva dismissed yolocs’s stale review May 26, 2022 20:53

added all asked changes.

@sethvargo sethvargo merged commit 31a075a into main May 26, 2022
@sethvargo sethvargo deleted the cli-lib branch May 26, 2022 21:08
sqin2019 pushed a commit that referenced this pull request Apr 6, 2023
* feat: add config class and logic

* PR feedback

* change version from float to integer

* changed int8 to uint 8 in config version

* feat: Added protobufs and gen_protos script

* added newline

* removed extra newline

* remove optional

* s/v1/v0

* adding implementation for jvs server

* add newly generated protos

* implementing jvs server

* minor updates

* adding config tests

* PR feedback

* Update pkg/config/justification_config.go

Co-authored-by: Seth Vargo <seth@sethvargo.com>

* feat: added signing code to jvs

* minor updates

* Update to not use gcp jwt library

* minor cosmetic fixes

* minor fixes

* PR feedback

* updated comment

* ran go mod tidy and go format

* PR feedback

* fix issue

* feat: Implementing cert rotation logic that leverages an external db to
save some state

* PR feedback

* cont'd

* PR feedback

* updates

* reduce nesting

* added working implementation & tests

* small fixes and comments

* tidy

* moar tests

* changed to use labels

* updated labels to match kms guidelines

* remove unnecessary config members

* added comment

* fix bug where current time is not updated.

* refactor to make state store an interface

* add required dependency to main

* added some comments

* move method into state store

* starting public key api

* PR feedback

* more public key implementation

* minor updates

* remove dependency, some PR feedback

* add cache

* only save primary in labels

* change to en cache

* fix one merge miss

* clean up rotation handler

* order similar functions together

* go mod tidy

* update to use zap

* PR feedback

* added the cache tests

* fix comment

* add return after http err

* fix some linter issues

* PR feedback

* Update pkg/jvscrypto/key_hosting_test.go

Co-authored-by: cshou <cshou@google.com>

* adding client libs

* added ECDSA key sanity check

* update some other strings to remove escaped quotes

* feat: adding client implementation

* few small improvements

* switched to JWX library

* formatting

* cache timeout validation

* remove print statements

* add doc

* Update client-lib/go/client/jvs_client.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* refactored tests

Co-authored-by: Seth Vargo <seth@sethvargo.com>
Co-authored-by: cshou <cshou@google.com>
verbanicm pushed a commit that referenced this pull request Jun 14, 2023
* feat: add config class and logic

* PR feedback

* change version from float to integer

* changed int8 to uint 8 in config version

* feat: Added protobufs and gen_protos script

* added newline

* removed extra newline

* remove optional

* s/v1/v0

* adding implementation for jvs server

* add newly generated protos

* implementing jvs server

* minor updates

* adding config tests

* PR feedback

* Update pkg/config/justification_config.go

Co-authored-by: Seth Vargo <seth@sethvargo.com>

* feat: added signing code to jvs

* minor updates

* Update to not use gcp jwt library

* minor cosmetic fixes

* minor fixes

* PR feedback

* updated comment

* ran go mod tidy and go format

* PR feedback

* fix issue

* feat: Implementing cert rotation logic that leverages an external db to
save some state

* PR feedback

* cont'd

* PR feedback

* updates

* reduce nesting

* added working implementation & tests

* small fixes and comments

* tidy

* moar tests

* changed to use labels

* updated labels to match kms guidelines

* remove unnecessary config members

* added comment

* fix bug where current time is not updated.

* refactor to make state store an interface

* add required dependency to main

* added some comments

* move method into state store

* starting public key api

* PR feedback

* more public key implementation

* minor updates

* remove dependency, some PR feedback

* add cache

* only save primary in labels

* change to en cache

* fix one merge miss

* clean up rotation handler

* order similar functions together

* go mod tidy

* update to use zap

* PR feedback

* added the cache tests

* fix comment

* add return after http err

* fix some linter issues

* PR feedback

* Update pkg/jvscrypto/key_hosting_test.go

Co-authored-by: cshou <cshou@google.com>

* adding client libs

* added ECDSA key sanity check

* update some other strings to remove escaped quotes

* feat: adding client implementation

* few small improvements

* switched to JWX library

* formatting

* cache timeout validation

* remove print statements

* add doc

* Update client-lib/go/client/jvs_client.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* Update client-lib/go/client/jvs_client_test.go

Co-authored-by: cshou <cshou@google.com>

* refactored tests

Co-authored-by: Seth Vargo <seth@sethvargo.com>
Co-authored-by: cshou <cshou@google.com>
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