-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CTFE Extra Data Issuance Chain Deduplication (#1477)
* CTFE Extra Data Issuance Chain Deduplication * Add CT server with MySQL configuration example * Update CTFE storage saving changelog * Fix always if true condition * Reuse `IsCTFEStorageEnabled` * Setting default cache size and ttl to -1 * Add code comments for `issuanceChainStorage` and `issuanceChainCache` * Fix incorrect NewIssuanceChainCache comment * Refactor `addChainInternal` and remove `buildLogLeafForAddChain` * Move cache flags to ct_server main * Remove TODO comment for `[]ct.ASN1Cert` to `[]byte` conversion * Add FixLogLeaf method comment * Return err in `GetByHash` and `Add` when storage is nil * Enable MySQL in ct server test * Refactor log leaf build logic * Fix `leaf` var scope bug * Rename method from public `Add` to private `add` * Refactor `issuanceChainService.FixLogLeaf` into `rpcGetLeavesByRange` and `rpcGetEntryAndProof` * Add `rpcGetLeavesByRange` and `rpcGetEntryAndProof` method comment * Add more information in CHANGELOG.md * Add table create command in `resetctdb.sh` * Add `extra_data_issuance_chain_storage_backends` config to integration test * Fix incorrect config name to `extra_data_issuance_chain_storage_backend` * Add missing `mysql://` in `ctfe_storage_connection_string` config * Update the hostname to `db` in `ctfe_storage_connection_string` config * Update the hostname to `mysql` in `ctfe_storage_connection_string` config * Update the tested MySQL version to 8.4 in CHANGELOG.md * Import MySQL schema in integration test flow * Fix missing `then` in `resetctdb.sh` * Update integration test to use cttest as the CTFE database * Reset the CT test database before launching CT personalities in integration test flow * Add `mariadb-client` to ct_testbase Dockerfile * Update comment * Export `MYSQL_HOST` in ct_functions.sh * Export `MYSQL_ROOT_PASSWORD` in ct_functions.sh * Export `MYSQL_USER_HOST` in ct_functions.sh * Add all combination of `extra_data_issuance_chain_storage_backend` config in integration test flow * Unexport `MYSQL_USER_HOST` for debugging * Revert: Unexport `MYSQL_USER_HOST` for debugging * Add debug log to `resectdb.sh` * Add "SHOW TABLES" in debug log * Add `USE ${MYSQL_DATABASE}; SHOW TABLES;` * Move CT test database reset to GCB step 3 (ci-ready) * Fix missing `$` in cloudbuild.yaml * Reset CT test database in cloudbuild_master.yaml * Update CHANGELOG.md * Remove duplicated comment * Rename `hash` to `chainHash` * Unexport `isCTFEStorageEnabled` method * Add comments for type/struct * Add code comment about the way we unmarshal leaf.ExtraData * Rename method to `ExtraDataForChainHash` and remove unused `chain` argument * Remove unused `chain` argument * Update `FixLogLeaf` method comment * Add buildLogLeaf method comment
- Loading branch information
Showing
21 changed files
with
431 additions
and
58 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,28 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// 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 noop defines the IssuanceChainCache type, which implements IssuanceChainCache interface with Get and Set operations. | ||
package noop | ||
|
||
import "context" | ||
|
||
type IssuanceChainCache struct{} | ||
|
||
func (c *IssuanceChainCache) Get(_ context.Context, key []byte) ([]byte, error) { | ||
return nil, nil | ||
} | ||
|
||
func (c *IssuanceChainCache) Set(_ context.Context, key []byte, chain []byte) error { | ||
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
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.