Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TrustStore: Implement sqlite database #3467

Merged
merged 8 commits into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go/lib/infra/modules/trust/v2/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type ChainRead interface {
// ChainExists returns whether the certificate chain is found in the
// database and the content matches. ErrContentMismatch is returned if any
// of the two certificates exist in the database with differing contents.
ChainExists(ctx context.Context, d decoded.TRC) (bool, error)
ChainExists(ctx context.Context, d decoded.Chain) (bool, error)
}

// ChainWrite defines the certificate chain write operations.
Expand Down
2 changes: 1 addition & 1 deletion go/lib/infra/modules/trust/v2/mock_v2/v2.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions go/lib/infra/modules/trust/v2/trustdbsqlite/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
srcs = [
"db.go",
"schema.go",
],
importpath = "github.com/scionproto/scion/go/lib/infra/modules/trust/v2/trustdbsqlite",
visibility = ["//visibility:public"],
deps = [
"//go/lib/addr:go_default_library",
"//go/lib/infra/modules/db: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/cert/v2:go_default_library",
"//go/lib/scrypto/trc/v2:go_default_library",
"//go/lib/serrors:go_default_library",
"//go/lib/util:go_default_library",
"@com_github_mattn_go_sqlite3//:go_default_library",
],
)

go_test(
name = "go_default_test",
srcs = ["db_test.go"],
embed = [":go_default_library"],
deps = [
"//go/lib/infra/modules/trust/v2/trustdbtest:go_default_library",
"@com_github_stretchr_testify//require:go_default_library",
],
)
Loading