forked from scionproto/scion
-
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.
TrustStore: Implement crypto provider
The crypto provider handles crypto material requests. If the requested crypto material is in the database, it is returned. Otherwise, the crypto provider decides based on the recurser whether it can issue a network request. If it is allowed to, it selects the path and remote using the router and calls resolver to resolve all the missing material. This PR is the start of a series of PRs that make the new trust store operational. The individual components are then glued together into the trust store. To the client package, the trust store appears as a single unit. Contributes to scionproto#3115
- Loading branch information
Showing
11 changed files
with
1,035 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2019 Anapaya Systems | ||
// | ||
// 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 trust | ||
|
||
var NewCryptoProvider = newTestCryptoProvider | ||
|
||
// newTestCryptoProvider returns a new crypto provider for testing. | ||
func newTestCryptoProvider(db DBRead, recurser Recurser, resolver Resolver, router Router, | ||
alwaysCacheOnly bool) CryptoProvider { | ||
|
||
return &cryptoProvider{ | ||
db: db, | ||
recurser: recurser, | ||
resolver: resolver, | ||
router: router, | ||
alwaysCacheOnly: alwaysCacheOnly, | ||
} | ||
} |
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,16 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = ["v2.go"], | ||
importpath = "github.com/scionproto/scion/go/lib/infra/modules/trust/v2/mock_v2", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//go/lib/addr:go_default_library", | ||
"//go/lib/infra/modules/trust/v2:go_default_library", | ||
"//go/lib/infra/modules/trust/v2/internal/decoded:go_default_library", | ||
"//go/lib/scrypto:go_default_library", | ||
"//go/lib/scrypto/trc/v2:go_default_library", | ||
"@com_github_golang_mock//gomock:go_default_library", | ||
], | ||
) |
Oops, something went wrong.