File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,8 +46,7 @@ time = ["dep:chrono", "dep:chrono-tz"]
4646uuid = [" dep:uuid" ]
4747urlquery = [" dep:url" ]
4848yaml = [" serde_yaml" ]
49- jwt = []
50- jwt_backend_openssl = [" openssl" ]
49+ jwt_openssl = [" openssl" ]
5150full-opa = [
5251 " base64" ,
5352 " base64url" ,
@@ -66,9 +65,7 @@ full-opa = [
6665 " time" ,
6766 " uuid" ,
6867 " urlquery" ,
69- " yaml" ,
70- " jwt" ,
71- " jwt_backend_openssl"
68+ " yaml"
7269 # "rego-extensions"
7370]
7471
@@ -146,6 +143,7 @@ num_cpus = "1.16"
146143
147144[build-dependencies ]
148145anyhow = " 1.0"
146+ openssl = { version = " 0.10.73" , optional = true }
149147
150148[profile .release ]
151149debug = true
Original file line number Diff line number Diff line change @@ -26,6 +26,22 @@ fn main() -> Result<()> {
2626 println ! ( "cargo:rustc-env=GIT_HASH={git_hash}" ) ;
2727 }
2828
29+ // Verify OpenSSL version
30+ #[ cfg( feature = "jwt_openssl" ) ]
31+ {
32+ use openssl:: version;
33+ // Minimal OpenSSL version that meets FIPS certification
34+ let min_ver_num = 0x30000000i64 ;
35+ let ver = version:: version ( ) ;
36+ let ver_num = version:: number ( ) ;
37+ if !ver. starts_with ( "OpenSSL" ) || ver_num < min_ver_num {
38+ panic ! (
39+ "FATAL: OpenSSL version must be 3.0.0 or higher, found version: {}" ,
40+ ver
41+ ) ;
42+ }
43+ }
44+
2945 // Rerun only if build.rs changes.
3046 println ! ( "cargo:rerun-if-changed=build.rs" ) ;
3147 Ok ( ( ) )
Original file line number Diff line number Diff line change 11// Copyright (c) Microsoft Corporation.
22// Licensed under the MIT License.
33
4- #[ cfg( feature = "jwt_backend_openssl " ) ]
4+ #[ cfg( feature = "jwt_openssl " ) ]
55pub mod openssl;
Original file line number Diff line number Diff line change 11// Copyright (c) Microsoft Corporation.
22// Licensed under the MIT License.
33
4- #[ cfg( feature = "jwt_backend_openssl " ) ]
4+ #[ cfg( feature = "jwt_openssl " ) ]
55use crate :: builtins:: jwt:: backends:: openssl:: OpensslBackend ;
66
7- #[ cfg( feature = "jwt_backend_openssl " ) ]
7+ #[ cfg( feature = "jwt_openssl " ) ]
88pub type JwtBackend = OpensslBackend ;
Original file line number Diff line number Diff line change @@ -49,9 +49,9 @@ mod utils;
4949#[ cfg( feature = "uuid" ) ]
5050mod uuid;
5151
52- #[ cfg( feature = "jwt " ) ]
52+ #[ cfg( feature = "jwt_openssl " ) ]
5353mod jwt;
54- #[ cfg( feature = "jwt " ) ]
54+ #[ cfg( feature = "jwt_openssl " ) ]
5555mod token_verification;
5656
5757#[ cfg( feature = "opa-testutil" ) ]
@@ -114,7 +114,7 @@ lazy_static! {
114114 tracing:: register( & mut m) ;
115115 units:: register( & mut m) ;
116116
117- #[ cfg( feature = "jwt " ) ]
117+ #[ cfg( feature = "jwt_openssl " ) ]
118118 token_verification:: register( & mut m) ;
119119
120120 #[ cfg( feature = "opa-testutil" ) ]
Original file line number Diff line number Diff line change @@ -43,11 +43,6 @@ v0/jsonfilteridempotent
4343v0/jsonremove
4444v0/jsonremoveidempotent
4545v0/jsonschema
46- v0/jwtbuiltins
47- v0/jwtverifyhs256
48- v0/jwtverifyhs384
49- v0/jwtverifyhs512
50- v0/jwtverifyrsa
5146v0/negation
5247v0/nestedreferences
5348v0/netcidrisvalid
@@ -155,11 +150,6 @@ v1/jsonfilteridempotent
155150v1/jsonremove
156151v1/jsonremoveidempotent
157152v1/jsonschema
158- v1/jwtbuiltins
159- v1/jwtverifyhs256
160- v1/jwtverifyhs384
161- v1/jwtverifyhs512
162- v1/jwtverifyrsa
163153v1/negation
164154v1/nestedreferences
165155v1/netcidrcontains
You can’t perform that action at this time.
0 commit comments