Skip to content

Commit

Permalink
add tsa mtls test to github actions
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry S <dsavints@gmail.com>
  • Loading branch information
dmitris committed Jul 15, 2023
1 parent 8286aa6 commit 85aa387
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,22 @@ jobs:
- name: Run e2e_test_secrets.sh
shell: bash
run: ./test/e2e_test_secrets.sh

e2e-tsa-mtls:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: '1.20.x'
check-latest: true

- uses: imjasonh/setup-crane@00c9e93efa4e1138c9a7a5c594acd6c75a2fbf0c # v0.3

- name: Run e2e_tsa_mtls.sh
shell: bash
run: make && PATH="$PWD:$PATH" ./test/e2e_tsa_mtls.sh
25 changes: 19 additions & 6 deletions test/tsa-mtls.sh → test/e2e_tsa_mtls.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
#!/bin/bash
set -euo pipefail
#!/usr/bin/env bash
#
# Copyright 2023 The Sigstore Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -exuo pipefail

## Requirements
# - cosign
# - crane
# - go

which cosign

CERT_BASE="testdata"
CERT_BASE="test/testdata"

TIMESTAMP_CACERT=$CERT_BASE/tsa-mtls-cacert.pem
TIMESTAMP_CLIENT_CERT=$CERT_BASE/tsa-mtls-client.pem
Expand Down Expand Up @@ -67,4 +80,4 @@ cosign verify --insecure-ignore-tlog --insecure-ignore-sct --check-claims=true \

# cleanup
rm -fr ca-key.pem cacert.pem cert.pem /tmp/timestamp-authority
pkill timestamp-server
pkill -f 'timestamp-server'

0 comments on commit 85aa387

Please sign in to comment.