|
| 1 | +use std::sync::LazyLock; |
| 2 | + |
1 | 3 | use super::Policy; |
2 | 4 |
|
3 | | -const SIGSUM_TEST1_2025: &str = include_str!("sigsum-test1-2025.builtin-policy"); |
4 | | -const SIGSUM_TEST2_2025: &str = include_str!("sigsum-test2-2025.builtin-policy"); |
5 | | -const SIGSUM_TEST_2025_3: &str = include_str!("sigsum-test-2025-3.builtin-policy"); |
6 | | -const SIGSUM_GENERIC_2025_1: &str = include_str!("sigsum-generic-2025-1.builtin-policy"); |
| 5 | +const SRC_SIGSUM_TEST1_2025: &str = include_str!("sigsum-test1-2025.builtin-policy"); |
| 6 | +const SRC_SIGSUM_TEST2_2025: &str = include_str!("sigsum-test2-2025.builtin-policy"); |
| 7 | +const SRC_SIGSUM_TEST_2025_3: &str = include_str!("sigsum-test-2025-3.builtin-policy"); |
| 8 | +const SRC_SIGSUM_GENERIC_2025_1: &str = include_str!("sigsum-generic-2025-1.builtin-policy"); |
| 9 | + |
| 10 | +pub static SIGSUM_TEST1_2025: LazyLock<Policy> = LazyLock::new(|| Policy::builtin("sigsum-test1-2025").unwrap()); |
| 11 | +pub static SIGSUM_TEST2_2025: LazyLock<Policy> = LazyLock::new(|| Policy::builtin("sigsum-test2-2025").unwrap()); |
| 12 | +pub static SIGSUM_TEST_2025_3: LazyLock<Policy> = LazyLock::new(|| Policy::builtin("sigsum-test-2025-3").unwrap()); |
| 13 | +pub static SIGSUM_GENERIC_2025_1: LazyLock<Policy> = LazyLock::new(|| Policy::builtin("sigsum-generic-2025-1").unwrap()); |
7 | 14 |
|
8 | 15 | impl Policy { |
9 | 16 | pub fn builtin(name: &str) -> Option<Self> { |
10 | 17 | match name { |
11 | | - "sigsum-test1-2025" => Some(Policy::parse(SIGSUM_TEST1_2025).unwrap()), |
12 | | - "sigsum-test2-2025" => Some(Policy::parse(SIGSUM_TEST2_2025).unwrap()), |
13 | | - "sigsum-test-2025-3" => Some(Policy::parse(SIGSUM_TEST_2025_3).unwrap()), |
14 | | - "sigsum-generic-2025-1" => Some(Policy::parse(SIGSUM_GENERIC_2025_1).unwrap()), |
| 18 | + "sigsum-test1-2025" => Some(Policy::parse(SRC_SIGSUM_TEST1_2025).unwrap()), |
| 19 | + "sigsum-test2-2025" => Some(Policy::parse(SRC_SIGSUM_TEST2_2025).unwrap()), |
| 20 | + "sigsum-test-2025-3" => Some(Policy::parse(SRC_SIGSUM_TEST_2025_3).unwrap()), |
| 21 | + "sigsum-generic-2025-1" => Some(Policy::parse(SRC_SIGSUM_GENERIC_2025_1).unwrap()), |
15 | 22 | _ => None, |
16 | 23 | } |
17 | 24 | } |
|
0 commit comments