Documentation ¶
Overview ¶
Package gitops handles interpreting changes to a git repository as RSoP differentials.
Index ¶
- func DownloadAuth(ctx context.Context, vc *vault.Client, authDirectory string) error
- func DownloadPolicies(ctx context.Context, vc *vault.Client, policyDirectory string) error
- func GetAuthPrincipalDifferential(repositoryPath, relativePrincipalPath, relativePolicyDirectory, ... string) (*internal.RSoPDifferential, error)
- func GetPolicyChangeDifferentials(changedFiles []ChangedFile, ...) (map[string]*internal.RSoPDifferential, error)
- func MustEmitMarkdownDiffs(ctx context.Context, gitDirectory, compareRef string)
- type ChangedFile
- type Git
- type Mutation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadAuth ¶
func DownloadPolicies ¶
func GetAuthPrincipalDifferential ¶
func GetAuthPrincipalDifferential(repositoryPath, relativePrincipalPath, relativePolicyDirectory, historicalGitRef string) (*internal.RSoPDifferential, error)
GetAuthPrincipalDifferential compares policies for an auth principal in the working copy to a historical git ref.
func GetPolicyChangeDifferentials ¶
func GetPolicyChangeDifferentials( changedFiles []ChangedFile, repositoryPath, policyName, relativePolicyDirectory, relativePrincipalDirectory, historicalGitRef string, ) (map[string]*internal.RSoPDifferential, error)
GetPolicyChangeDifferentials returns an RSoP differential for every auth principal that involves this policy.
func MustEmitMarkdownDiffs ¶
Prints RSoPDifferential tables for all changes made to auth principals and policies between `compareRef` and the current working copy.
Uses log.Fatal() instead of returning an error because it's directly called by a command.
Types ¶
type ChangedFile ¶
type ChangedFile struct { Path string Mutation Mutation Principal bool `json:",omitempty"` Policy bool `json:",omitempty"` }
func GetChangedFiles ¶
func GetChangedFiles(ctx context.Context, repo string, referenceName string) ([]ChangedFile, string, error)
Computes a change between HEAD and some reference, like a branch. Leave blank to use the default branch, which is usually named main or master.
Returns the branch used.