Skip to content
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

There are defined data structures for annotation parsing in M1 #341

Open
1 task
rpothier opened this issue Jun 23, 2021 · 1 comment
Open
1 task

There are defined data structures for annotation parsing in M1 #341

rpothier opened this issue Jun 23, 2021 · 1 comment

Comments

@rpothier
Copy link
Contributor

rpothier commented Jun 23, 2021

For the M1 push to file feature the Secrets provider will use Kubernetes annotations to
list the secrets that will be retrieved from Conjur.

When configured for push to file, the annotations will need to be parsed and the results
saved to a a data structure.

Requirements

When the Secrets Provider container starts up, it will need to parse the annotations file.
The Secrets Provider will need to parse all Pod annotations, and compile an array of per-group secrets mapping information.

Each annotation key will be parsed and split into three fields:

  • Annotation type (e.g. conjur-secrets, conjur-secrets-policy-path, etc)
  • Secrets group
  • Annotation value. The annotation value is a string that can be any of the following formats:
    • Plain string
    • YAML list of secrets
    • Secrets file Golang template

The parsed annotations need to be saved in a data structure as outlined below from the spec.

// SecretsPaths comprises Conjur variable paths for all secrets in a secrets group, indexed by secret name.
type SecretsPaths map[string]string

// GroupSecretsInfo comprises secrets mapping information for a given secrets group.
type GroupSecretsInfo struct {
    Secrets SecretsPaths
    SecretsPathPrefix string
    FilePath string
    FileFormat int
    Template string
}

// GroupSecrets comprises secrets mapping info for all secrets groups
var GroupSecrets map[string]GroupSecretsInfo{}

Acceptance Criteria

  • The data structures exist for parsing the annotations.
@rpothier rpothier self-assigned this Jun 23, 2021
@rpothier rpothier changed the title There are defined data structures for annotation parsing There are defined data structures for annotation parsing in M1 Jun 24, 2021
@rpothier rpothier removed their assignment Jun 24, 2021
@jtuttle
Copy link
Member

jtuttle commented Jul 19, 2021

This is a design / spike story to come up with a starting point for a data structure to work with when parsing annotations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants