| {# |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you 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. |
| #} |
| |
| #[derive(Debug)] |
| pub struct BuildConfig { |
| pub as_root_ca_cert: &'static [u8], |
| pub auditor_public_keys: &'static [&'static [u8]; {{ auditor_public_keys.len() }}], |
| pub grpc_config: GrpcConfig, |
| pub attestation_validity_secs: u64, |
| pub inbound: Inbounds, |
| } |
| |
| #[derive(Debug)] |
| pub struct GrpcConfig { |
| pub max_encoding_message_size: usize, |
| pub max_decoding_message_size: usize, |
| } |
| |
| #[derive(Debug)] |
| pub struct Inbounds { |
| pub access_control: &'static [&'static str; {{ inbound.access_control.len() }}], |
| pub authentication: &'static [&'static str; {{ inbound.authentication.len() }}], |
| pub management: &'static [&'static str; {{ inbound.management.len() }}], |
| pub storage: &'static [&'static str; {{ inbound.storage.len() }}], |
| pub scheduler: &'static [&'static str; {{ inbound.scheduler.len() }}], |
| } |
| |
| pub const BUILD_CONFIG: BuildConfig = BuildConfig { |
| as_root_ca_cert: &{{ as_root_ca_cert }}, |
| auditor_public_keys: &[ |
| {%- for k in auditor_public_keys %} |
| &{{ k }}, |
| {%- endfor %} |
| ], |
| grpc_config: GrpcConfig { |
| max_encoding_message_size: {{ grpc_config.max_encoding_message_size }}, |
| max_decoding_message_size: {{ grpc_config.max_decoding_message_size }}, |
| }, |
| attestation_validity_secs: {{ attestation_validity_secs }}, |
| inbound: Inbounds { |
| access_control: &[ |
| {%- for s in inbound.access_control %} |
| "{{ s }}", |
| {%- endfor %} |
| ], |
| authentication: &[ |
| {%- for s in inbound.authentication %} |
| "{{ s }}", |
| {%- endfor %} |
| ], |
| management: &[ |
| {%- for s in inbound.management %} |
| "{{ s }}", |
| {%- endfor %} |
| ], |
| storage: &[ |
| {%- for s in inbound.storage %} |
| "{{ s }}", |
| {%- endfor %} |
| ], |
| scheduler: &[ |
| {%- for s in inbound.scheduler %} |
| "{{ s }}", |
| {%- endfor %} |
| ], |
| } |
| }; |