-
Notifications
You must be signed in to change notification settings - Fork 2
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
Command to support listing secrets #8
Conversation
6351276
to
8abdfa6
Compare
8abdfa6
to
bbc7f01
Compare
client/client.go
Outdated
type GetSecretListConfig struct { | ||
Environment string `json:"environment"` | ||
} | ||
type GetSecretListResponse struct { |
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.
We could ignore Get
prefix https://go.dev/doc/effective_go#Getters
client/gcs_service.go
Outdated
@@ -23,7 +24,7 @@ type Service struct { | |||
type gcsStore interface { | |||
WriteToObject(ctx context.Context, bucketName, fileName string, data []byte) error | |||
ReadObject(ctx context.Context, bucketName, fileName string) ([]byte, error) | |||
ListOjbect(ctx context.Context, bucketName, path string) ([]string, error) | |||
ListObject(ctx context.Context, bucketName, path string) ([]google.SecretObject, 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.
It could be google.Object
from google's package perspective (GCS object), it doesn't know anything about secrets. In callers, it could be used for secrets or users or any abstraction.
@@ -77,13 +78,13 @@ func (s Service) GetOrgPublicKeys(ctx context.Context, env, bucketName, path str | |||
if pubKey != "" { | |||
return []string{pubKey}, nil | |||
} | |||
resp, err := s.store.ListOjbect(ctx, bucketName, path) |
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.
If it's meant for abstraction/local, keep it private.
Also i don't see any logic handled under GetObjList
except just returning error and repeated here as well, why do we need this method?
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.
The GetObjList is added beause i dont wnat client to directly call store.ListObject
client/monart.go
Outdated
if err != nil { | ||
return nil, fmt.Errorf("unable to build Get SecretList request: %w", err) | ||
} | ||
result := new(GetSecretListResponse) |
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.
We should have a response type here and we should be building location here, google/gcs.go
should only set the fields as is.
5a570f3
to
03b804d
Compare
03b804d
to
16b46d5
Compare
bab75ea
to
394ac1a
Compare
394ac1a
to
636edc8
Compare
|
listing all the secrets in cloud and show in tabuler commandline output.