Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
github.com/loveholidays/go-config-loader
go-config-loader is a library that allows config to be read from yaml files. A common problem with reading from config files in go is ensuring required values are set. Historically there are two ways of handling this:
Introducing go-config-loader. The library allows the setting of a required flag in the object declaration. When the flag is set, the library will check the config yaml file for the variable and error if it isn't present. This solves the zero values issue and means there is no need to make config variables nullable. The flag is set to false by default.
The library also has the ability to interpolate environment variable values into yaml files when the variables are
formatted in the way illustrated below. This can be useful for reading in secrets and sensitive content that should not
be stored in version control. The api_key
variable will be set to the value of MY_SECRET_API_KEY
when the config is
loaded.
api_key: "$MY_SECRET_API_KEY"
package main
import (
config "github.com/loveholidays/go-config-loader"
)
type genericConfig struct {
DummyConfig1 string `yaml:"dummy_config_1" required:"true"`
DummyConfig2 string `yaml:"dummy_config_2"`
DummyConfig3 string `yaml:"dummy_config_3"`
}
func main() {
_, err := config.LoadConfiguration[genericConfig]("config.yaml")
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.