forked from notaryproject/notation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix&test: discard error for NewFileCache & E2E test for CRL with cache (
notaryproject#1079) Fix: - discard error when NewFileCache failed: any cache errors should not block the verification process Test: - added `crl_server.py` script to run in the background as a mock CRL server - added a `gen_crl_testing_certs.sh` script for generating required certificate chain for testing CRL - added 8 E2E test cases for CRL and CRL cache - refactored E2E framework to allow add test key from different folders Bump: - updated ginkgo to v2.21.0 Resolves notaryproject#1068 Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
- Loading branch information
Showing
23 changed files
with
910 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// Copyright The Notary Project 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. | ||
|
||
package utils | ||
|
||
import ( | ||
"fmt" | ||
"net/http" | ||
) | ||
|
||
// LeafCRLRevoke sends http post request to http://localhost:10086/leaf/revoke | ||
func LeafCRLRevoke() error { | ||
url := "http://localhost:10086/leaf/revoke" | ||
resp, err := http.Post(url, "application/json", nil) | ||
if err != nil { | ||
return err | ||
} | ||
defer resp.Body.Close() | ||
fmt.Printf("CRL of leaf certificate revoked with status code: %d\n", resp.StatusCode) | ||
return nil | ||
} | ||
|
||
// LeafCRLUnrevoke sends http post request to http://localhost:10086/leaf/unrevoke | ||
func LeafCRLUnrevoke() error { | ||
url := "http://localhost:10086/leaf/unrevoke" | ||
resp, err := http.Post(url, "application/json", nil) | ||
if err != nil { | ||
return err | ||
} | ||
defer resp.Body.Close() | ||
fmt.Printf("CRL of leaf certificate unrevoked with status code: %d\n", resp.StatusCode) | ||
return nil | ||
} | ||
|
||
// LeafCRLExpired sends http post request to http://localhost:10086/leaf/expired | ||
func LeafCRLExpired() error { | ||
url := "http://localhost:10086/leaf/expired" | ||
resp, err := http.Post(url, "application/json", nil) | ||
if err != nil { | ||
return err | ||
} | ||
defer resp.Body.Close() | ||
fmt.Printf("CRL of leaf certificate expired with status code: %d\n", resp.StatusCode) | ||
return nil | ||
} | ||
|
||
// IntermediateCRLRevoke sends http post request to http://localhost:10086/intermediate/revoke | ||
func IntermediateCRLRevoke() error { | ||
url := "http://localhost:10086/intermediate/revoke" | ||
resp, err := http.Post(url, "application/json", nil) | ||
if err != nil { | ||
return nil | ||
} | ||
defer resp.Body.Close() | ||
fmt.Printf("CRL of intermediate certificate revoked with status code: %d\n", resp.StatusCode) | ||
return nil | ||
} | ||
|
||
// IntermediateCRLUnrevoke sends http post request to http://localhost:10086/intermediate/unrevoke | ||
func IntermediateCRLUnrevoke() error { | ||
url := "http://localhost:10086/intermediate/unrevoke" | ||
resp, err := http.Post(url, "application/json", nil) | ||
if err != nil { | ||
return nil | ||
} | ||
defer resp.Body.Close() | ||
fmt.Printf("CRL of intermediate certificate unrevoked with status code: %d\n", resp.StatusCode) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.