Skip to content

Support syft application configuration in the syft lib #4264

@wagoodman

Description

@wagoodman

What would you like to be added:
I'd like to be able to have an application that can respond to SYFT_ environment variables optionally when crafting a CreateSBOMConfig and any other capabilities at the top-level of the syft API.

This could encompass the full application configuration:

# if paths given, search for configs on disk at one or more paths, the first hit wins.
# if an environment access interface is given then override path values with those found from the env vars
syft.LoadConfig(paths []string, environment envInterface) *Config
syft.ConfigLocations() []string

... or could be limited to top-level api configs:

# exists today
syft.DefaultCreateSBOMConfig() *CreateSBOMConfig

# if paths given, search for configs on disk at one or more paths, the first hit wins.
# if an environment access interface is given then override path values with those found from the env vars
# use the default if nothing is found
syft.LoadCreateSBOMConfig(paths []string, environment envInterface) *CreateSBOMConfig

There are other options here

Why is this needed:
This allows for lib users to operate in environments that already have syft configured via environment variables seamlessly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions