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

Migrate github to ci provider flow #1738

Merged
merged 6 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions config/identity/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

define: &github-type "github-workflow"

oidc-issuers:
https://accounts.google.com:
issuer-url: https://accounts.google.com
Expand Down Expand Up @@ -84,7 +86,8 @@ oidc-issuers:
https://token.actions.githubusercontent.com:
issuer-url: https://token.actions.githubusercontent.com
client-id: sigstore
type: github-workflow
type: ci-provider
ci-provider: *github-type
contact: [email protected]
description: "GitHub Actions OIDC auth"
meta-issuers:
Expand All @@ -102,5 +105,30 @@ meta-issuers:
type: kubernetes
https://token.actions.githubusercontent.com/*:
client-id: sigstore
type: github-workflow

type: ci-provider
ci-provider: *github-type
ci-issuer-metadata:
*github-type:
default-template-values:
url: "https://github.com"
extension-templates:
github-workflow-trigger: "event_name"
github-workflow-sha: "sha"
github-workflow-name: "workflow"
github-workflow-repository: "repository"
github-workflow-ref: "ref"
build-signer-uri: "{{ .url }}/{{ .job_workflow_ref }}"
build-signer-digest: "job_workflow_sha"
runner-environment: "runner_environment"
source-repository-uri: "{{ .url }}/{{ .repository }}"
source-repository-digest: "sha"
source-repository-ref: "ref"
source-repository-identifier: "repository_id"
source-repository-owner-uri: "{{ .url }}/{{ .repository_owner }}"
source-repository-owner-identifier: "repository_owner_id"
build-config-uri: "{{ .url }}/{{ .workflow_ref }}"
build-config-digest: "workflow_sha"
build-trigger: "event_name"
run-invocation-uri: "{{ .url }}/{{ .repository }}/actions/runs/{{ .run_id }}/attempts/{{ .run_attempt }}"
source-repository-visibility-at-signing: "repository_visibility"
subject-alternative-name-template: "{{ .url }}/{{ .job_workflow_ref }}"
7 changes: 5 additions & 2 deletions pkg/config/fulcio_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ func TestLoadFulcioConfig(t *testing.T) {
t.Errorf("expected %s, got %s", issuerURL, got.IssuerURL)
}
if string(got.Type) == "" {
t.Errorf("Issuer Type should not be empty")
t.Errorf("issuer Type should not be empty")
}
if got.Type == IssuerTypeCIProvider {
if got.CIProvider == "" {
t.Errorf("Issuer CIProvider should not be empty when Type is ci-provider")
t.Errorf("issuer that is CIProvider field shouldn't be empty when Type is ci-provider")
}
if _, ok := fulcioConfig.CIIssuerMetadata[got.CIProvider]; !ok {
t.Error("isseuer with type ci provider should has the same ci provider name as key for CIIssuerMetadata")
javanlacerda marked this conversation as resolved.
Show resolved Hide resolved
}
}
if _, ok := fulcioConfig.GetIssuer("not_an_issuer"); ok {
Expand Down
Loading