-
Notifications
You must be signed in to change notification settings - Fork 5.7k
chore: Fix linter findings for revive:exported
in plugins/secretstores
#17017
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
chore: Fix linter findings for revive:exported
in plugins/secretstores
#17017
Conversation
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.
@zak-pawel Thanks for the contribution!
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.
@zak-pawel I think we agreed on keeping configuration structs exported, didn't we?
type AesEncryptor struct { | ||
type aesEncryptor struct { | ||
Variant []string `toml:"-"` | ||
Key config.Secret `toml:"key"` | ||
Vec config.Secret `toml:"init_vector"` | ||
KDFConfig | ||
kdfConfig |
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.
Hmmm didn't we agree on exporting configuration structs?
type DecryptionConfig struct { | ||
type decryptionConfig struct { | ||
Cipher string `toml:"cipher"` | ||
Aes AesEncryptor `toml:"aes"` | ||
Aes aesEncryptor `toml:"aes"` | ||
} |
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.
Config struct...
type KDFConfig struct { | ||
type kdfConfig struct { | ||
Algorithm string `toml:"kdf_algorithm"` | ||
Passwd config.Secret `toml:"password"` | ||
Salt config.Secret `toml:"salt"` |
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.
Config struct.
type tokenConfig struct { | ||
Key string `toml:"key"` | ||
ClientID config.Secret `toml:"client_id"` | ||
ClientSecret config.Secret `toml:"client_secret"` | ||
Scopes []string `toml:"scopes"` | ||
Params map[string]string `toml:"parameters"` | ||
} | ||
|
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.
Config struct
…ecretstores # Conflicts: # .golangci.yml
@srebhan Hmmm, I don't remember the details, but I think we agreed on that for the "main" struct of each plugin. |
@zak-pawel, OK let's keep them unexported then. I remember that we had some issues somewhere. IIRC this would prevent any future config helper tool to determine the type of the TOML setting which is only avail in the struct... But as I miss out on the details and everything seems to work, I'm not holding up this PR. In the worst case we need to export those again... |
Summary
Address findings for revive:exported in
plugins/secretstores
.As part of this effort for files from
plugins/secretstores
, the following actions were taken:const
,var
,struct
,func
, etc) were changed to unexported, wherever they didn't need to be exported.Init |SampleConfig |Gather |Start |Stop |GetState |SetState |SetParser |SetParserFunc |SetTranslator |Probe |Get |Set |List |GetResolver
).init
at the very end).It is only part of the bigger work (for issue: #15813).
Checklist