Commit graph

53 commits

Author SHA1 Message Date
Cody Soyland
ad2cfe074f
Add mutex to fix race in attestation test client
Signed-off-by: Cody Soyland <codysoyland@github.com>
2025-02-13 10:18:30 -05:00
Meredith Lancaster
fc2f18c896 consolidate tests around getBundle func when possible
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-30 11:12:58 -07:00
Meredith Lancaster
795263524d change permanent backoff error condition
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-30 11:11:41 -07:00
Meredith Lancaster
e9f7761423 dont retry when parsing fails
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-30 09:56:06 -07:00
Meredith Lancaster
dcb182b453 Merge branch 'trunk' into attestation-bundle-fetch-improvements 2025-01-30 09:53:27 -07:00
Meredith Lancaster
70ae9f39ef update tests to account for logic flip
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-30 09:26:41 -07:00
Meredith Lancaster
ddb8855198 flip bundle fetching logic
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-30 09:12:48 -07:00
Meredith Lancaster
5df2b47d1f update tests
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-24 09:30:46 -07:00
Meredith Lancaster
1d807c2291 add missing return statement
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-13 12:50:58 -07:00
Meredith Lancaster
611eb86e68 method update
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-13 12:47:25 -07:00
Meredith Lancaster
b7f6af03b5 update no attestations found err
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-13 12:42:10 -07:00
Meredith Lancaster
fc0d0210c0 remove old tests
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-13 12:21:27 -07:00
Meredith Lancaster
5462582401 drop unneeded methods
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-13 11:05:17 -07:00
Meredith Lancaster
40e7353b52 deduplicate get attestation code
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-13 11:02:33 -07:00
Meredith Lancaster
4d99ae920c fix tests
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-13 10:34:06 -07:00
Meredith Lancaster
c7d04c980b update testing
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-13 08:34:15 -07:00
Meredith Lancaster
8ad877b188 add check for invalid attestation
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-08 08:38:43 -07:00
Meredith Lancaster
33d0002d21 update tests to use new function name
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-07 15:22:02 -07:00
Meredith Lancaster
8d89dd97fd
Update pkg/cmd/attestation/api/client.go
Co-authored-by: Phill MV <phillmv@github.com>
2025-01-07 15:14:53 -07:00
Meredith Lancaster
51a74aed1d
Update pkg/cmd/attestation/api/client.go
Co-authored-by: Phill MV <phillmv@github.com>
2025-01-07 15:14:23 -07:00
Meredith Lancaster
42cb2547cd remove old comment
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-07 14:13:50 -07:00
Meredith Lancaster
f46cccbab4 comment
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-07 12:03:49 -07:00
Meredith Lancaster
258c69cd26 undo more name chanages
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-07 11:56:05 -07:00
Meredith Lancaster
0a602fae07 undo other name change
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-07 11:54:02 -07:00
Meredith Lancaster
7838e912b6 more mock http client cleanup
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-07 11:37:02 -07:00
Meredith Lancaster
9d88ca8cf8 simplify mock http client
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-07 11:32:49 -07:00
Meredith Lancaster
ecf55c6c16 use mock to assert number of http calls
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-07 10:54:17 -07:00
Meredith Lancaster
e34e188ee2 add http client test constructors
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-07 10:43:24 -07:00
Meredith Lancaster
9ecd90c26c setup testing struct for test cases
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-07 10:24:42 -07:00
Meredith Lancaster
69865117ab add mutex for test field
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-06 13:14:02 -07:00
Meredith Lancaster
0202ca8df5 add test case for bundle url fetch failure
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-06 12:58:09 -07:00
Meredith Lancaster
e03a36ea3c add tests for bundle url fetch and fallback
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-06 12:12:26 -07:00
Meredith Lancaster
070b67e5a4 fetch bundles in parallel
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-06 10:44:55 -07:00
Meredith Lancaster
311f2b2e23 return fetch attestations err directly
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-06 10:39:40 -07:00
Meredith Lancaster
9051da39fc provide additional logging and fallback
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-01-06 10:19:47 -07:00
Meredith Lancaster
ab4912ff48 fix failing tests
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-12-16 12:40:13 -07:00
Meredith Lancaster
e4431a3f55 add mock http client
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-12-16 12:22:20 -07:00
Meredith Lancaster
fb020f2a79 update error messages
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-12-16 12:13:22 -07:00
Meredith Lancaster
8f5d7100f5 var naming
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-12-16 12:02:52 -07:00
Meredith Lancaster
6b95175363 add httpClient field to LiveClient struct
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-12-16 11:57:45 -07:00
Meredith Lancaster
e51b4efaa9 remove unused method
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-12-16 11:50:46 -07:00
Meredith Lancaster
5a6a7968a3 fetch bundles with sas url
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-12-16 11:25:43 -07:00
Meredith Lancaster
bfd140c0e5 initial pass at fetching bundles with sas urls
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-11-06 07:57:18 -07:00
Phill MV
de4c05fb61 Linting: now that mockDataGenerator has an embedded mock, we ought to have pointer receivers in its funcs. 2024-10-21 14:32:32 -04:00
Phill MV
e7446676b6 Minor tweaks, added backoff to getTrustDomain 2024-10-21 12:44:51 -04:00
Phill MV
fafda48905 added test for verifying we do 3 retries when fetching attestations. 2024-10-21 12:32:57 -04:00
Phill MV
efc1c97cf1 Added constant backoff retry to getAttestations. 2024-10-21 12:10:18 -04:00
Phill MV
664e09fdbc wip: added test that fails in the absence of a backoff. 2024-10-21 11:20:46 -04:00
Fredrik Skogman
1b59ec8ad0
This commit introduces tenancy aware attestation policy building.
This is done by inspecting the current hostname to determine if
tenancy is enabled.

The attestation commands also accepts a --hostname parameter, that
is used to pick the current host, similar to how the GH_HOST variable
can be used.

Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
2024-09-11 10:49:17 +02:00
Cody Soyland
ea1a3da1eb
Rename ProtobufBundle to Bundle
Signed-off-by: Cody Soyland <codysoyland@github.com>
2024-09-04 16:45:02 -04:00