-
Notifications
You must be signed in to change notification settings - Fork 23
Add server/config package. #320
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
Merged
+601
−0
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c1aa203
Tidy up code for consistency.
Chounoki 8e83bf6
Merge branch 'openconfig:main' into main
Chounoki 9c5075d
Minor optimization for allocating blob buffer.
Chounoki 659a31c
Merge branch 'openconfig:main' into main
Chounoki a91d5c8
Merge branch 'openconfig:main' into main
Chounoki 6be32d8
Merge branch 'openconfig:main' into main
Chounoki 56a41e4
Merge branch 'openconfig:main' into main
Chounoki 2e0984d
Add server/config package.
Chounoki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,53 @@ | ||
| # Copyright 2023 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 | ||
| # | ||
| # https://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. | ||
|
|
||
| load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") | ||
| load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
| load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") | ||
|
|
||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
| proto_library( | ||
| name = "config_proto", | ||
| srcs = ["config.proto"], | ||
| import_prefix = "github.com/openconfig/bootz", | ||
| deps = [ | ||
| "//proto:bootz_proto", | ||
| "@openconfig_attestz//proto:tpm_enrollz_proto", | ||
| "@openconfig_gnsi//authz:authz_proto", | ||
| "@openconfig_gnsi//pathz:pathz_proto", | ||
| ], | ||
| ) | ||
|
|
||
| ############################################################################## | ||
| # Go | ||
| ############################################################################## | ||
|
|
||
| go_proto_library( | ||
| name = "config_go_proto", | ||
| importpath = "github.com/openconfig/bootz/server/proto/config", | ||
| proto = ":config_proto", | ||
| deps = [ | ||
| "//proto:bootz", | ||
| "@openconfig_attestz//proto:tpm_enrollz_go", | ||
| "@openconfig_gnsi//authz", | ||
| "@openconfig_gnsi//pathz", | ||
| ], | ||
| ) | ||
|
|
||
| go_library( | ||
| name = "config", | ||
| embed = [":config_go_proto"], | ||
| importpath = "github.com/openconfig/bootz/server/proto/config", | ||
| ) |
This file contains hidden or 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,87 @@ | ||
| // Copyright 2023 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 | ||
| // | ||
| // https://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. | ||
|
|
||
| syntax = "proto3"; | ||
|
|
||
| package config; | ||
|
|
||
| import "github.com/openconfig/attestz/proto/tpm_enrollz.proto"; | ||
| import "github.com/openconfig/bootz/proto/bootz.proto"; | ||
| import "github.com/openconfig/gnsi/authz/authz.proto"; | ||
| import "github.com/openconfig/gnsi/pathz/pathz.proto"; | ||
|
|
||
| option go_package = "github.com/openconfig/bootz/server/proto/config"; | ||
|
|
||
| // A binding configuration for Bootz server. | ||
| message Config { | ||
| // Bootz server address (IP:port). | ||
| string server_address = 1; | ||
|
Chounoki marked this conversation as resolved.
|
||
| // Bootz server trust anchor cert key pair. | ||
| CertKeyPair trust_anchor = 2; | ||
| // Owner certificate key pair. | ||
| CertKeyPair owner_certificate = 3; | ||
| // Based64 encoding of ASN.1 DER vendor CA certificates. | ||
| repeated string vendor_ca_certs = 4; | ||
| // Chassis owned by the organization. | ||
| repeated Chassis chassis = 5; | ||
| } | ||
|
|
||
| message CertKeyPair { | ||
| // Base64 encoding of ASN.1 DER certificate. | ||
| string cert = 1; | ||
| // Base64 encoding of PKCS#8 DER private key. | ||
| string key = 2; | ||
|
Chounoki marked this conversation as resolved.
|
||
| } | ||
|
|
||
| message Chassis { | ||
| // Chassis manufacturer. | ||
| string manufacturer = 1; | ||
| // For fixed form factor chassis, populate only 1 control card to represent | ||
| // the chassis itself. For modular form factor chassis, populate 2 control | ||
| // cards. | ||
| repeated ControlCard control_cards = 2; | ||
| // The intended hostname of the chassis. | ||
| string hostname = 3; | ||
| // Boot mode defines the boot mode that can be secure or insecure. | ||
| bootz.BootMode boot_mode = 4; | ||
| // Whether Streaming Bootz is supported or not. | ||
| bool streaming_supported = 5; | ||
| // Software image to be loaded on the chassis. | ||
| bootz.SoftwareImage intended_image = 6; | ||
|
Chounoki marked this conversation as resolved.
|
||
| // Bootloader password. | ||
| string boot_password_hash = 7; | ||
| // Boot config to be loaded on the chassis. | ||
| bootz.BootConfig boot_config = 8; | ||
| // Credentials. | ||
| bootz.Credentials credentials = 9; | ||
| // Pathz. | ||
| gnsi.pathz.v1.UploadRequest pathz = 10; | ||
| // Authz. | ||
| gnsi.authz.v1.UploadRequest authz = 11; | ||
| // Certz profiles. | ||
| bootz.CertzProfiles certz_profiles = 12; | ||
| } | ||
|
|
||
| message ControlCard { | ||
| // Serial number of the control card. | ||
| string serial_number = 1; | ||
| // Base64 encoding of ownership voucher. | ||
| string ownership_voucher = 2; | ||
| // Base64 encoding of PKIX DER EK/PPK public key. | ||
| // This field is not populated for control cards having IDevID. | ||
| string public_key = 3; | ||
|
Chounoki marked this conversation as resolved.
|
||
| // Public key type: EK or PPK. | ||
| // This field is not populated for control cards having IDevID. | ||
| openconfig.attestz.Key public_key_type = 4; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.