Skip to content

Allow secretspec to clean up orphaned secrets #245

Description

@ap-1

Moved from #237 (comment):

Currently, it is easy to remove unused/deprecated secrets from secretspec.toml and forget to remove them from the actual provider. Once secretspec can delete secrets, it should be able to take care of this for us by finding and deleting "orphaned" secrets no longer declared in secretspec.toml.

This should be a manual step, akin to how secretspec currently finds and prompts for missing secrets declared in secretspec.toml but not stored in the provider, since secretspec cannot know whether an undeclared secret is truly no longer in use (this is especially true for ref secrets / paths that lie outside of secretspec's {project}/{profile}/{key} structure)

This makes me think it should be a new flag on secretspec check, something like secretspec check --delete-orphaned, which is similar to secretspec import --delete-source implemented in #237. Alternatively, if a dedicated command is cleaner, something like secretspec sync would make sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions