@@ -109,6 +109,11 @@ pub(crate) struct RhtasArgs {
109109 #[ arg( long) ]
110110 fulcio_uri : Option < String > ,
111111
112+ /// URI for the OIDC provider (used with Fulcio).
113+ /// Example: <https://oauth2.sigstore.dev/auth>
114+ #[ arg( long) ]
115+ oidc_uri : Option < String > ,
116+
112117 /// Path to the new Ctlog target file
113118 #[ arg( long = "set-ctlog-target" ) ]
114119 ctlog_target : Option < PathBuf > ,
@@ -677,6 +682,11 @@ impl RhtasArgs {
677682 start = None ;
678683 }
679684
685+ let valid_for = Some ( TimeRange {
686+ start : start. clone ( ) ,
687+ end : end. clone ( ) ,
688+ } ) ;
689+
680690 let mut certificates: Vec < X509Certificate > = Vec :: new ( ) ;
681691 for item in certificate_raw_bytes_vec {
682692 certificates. push ( X509Certificate { raw_bytes : item } ) ;
@@ -689,7 +699,7 @@ impl RhtasArgs {
689699 } ) ,
690700 uri : self . fulcio_uri . clone ( ) . unwrap ( ) ,
691701 cert_chain : Some ( X509CertificateChain { certificates } ) ,
692- valid_for : Some ( TimeRange { start , end } ) ,
702+ valid_for : valid_for . clone ( ) ,
693703 operator : String :: new ( ) ,
694704 } ;
695705
@@ -701,6 +711,16 @@ impl RhtasArgs {
701711 eprintln ! ( "Failed to set target: {e:?} in trust_bundle" ) ;
702712 }
703713 }
714+
715+ if let Some ( ref oidc_uri) = self . oidc_uri {
716+ if let Err ( e) = trust_bundle. add_oidc_url_to_signing_config (
717+ oidc_uri. clone ( ) ,
718+ valid_for,
719+ "sigstore.dev" . to_string ( ) ,
720+ ) {
721+ eprintln ! ( "Failed to add OIDC URL to signing_config: {e:?}" ) ;
722+ }
723+ }
704724 }
705725 Ok ( ( ) )
706726 }
@@ -1089,14 +1109,15 @@ impl RhtasArgs {
10891109 || self . tsa_status . is_some ( ) )
10901110 {
10911111 return error:: InvalidArgumentCombinationSnafu {
1092- msg : "--set-fulcio-target only accepts --fulcio-uri and --fulcio-status."
1112+ msg : "--set-fulcio-target only accepts --fulcio-uri, --fulcio-status, and --oidc-uri ."
10931113 . to_string ( ) ,
10941114 }
10951115 . fail ( ) ;
10961116 }
10971117
10981118 if self . ctlog_target . is_some ( )
10991119 && ( self . fulcio_uri . is_some ( )
1120+ || self . oidc_uri . is_some ( )
11001121 || self . rekor_uri . is_some ( )
11011122 || self . tsa_uri . is_some ( )
11021123 || self . fulcio_status . is_some ( )
@@ -1111,6 +1132,7 @@ impl RhtasArgs {
11111132
11121133 if self . rekor_target . is_some ( )
11131134 && ( self . fulcio_uri . is_some ( )
1135+ || self . oidc_uri . is_some ( )
11141136 || self . ctlog_uri . is_some ( )
11151137 || self . tsa_uri . is_some ( )
11161138 || self . fulcio_status . is_some ( )
@@ -1125,6 +1147,7 @@ impl RhtasArgs {
11251147
11261148 if self . tsa_target . is_some ( )
11271149 && ( self . fulcio_uri . is_some ( )
1150+ || self . oidc_uri . is_some ( )
11281151 || self . ctlog_uri . is_some ( )
11291152 || self . rekor_uri . is_some ( )
11301153 || self . fulcio_status . is_some ( )
@@ -1144,6 +1167,9 @@ impl RhtasArgs {
11441167 if self . fulcio_status . is_none ( ) {
11451168 self . fulcio_status = Some ( String :: from ( "Active" ) ) ;
11461169 }
1170+ if self . oidc_uri . is_none ( ) {
1171+ self . oidc_uri = Some ( String :: from ( "https://oauth2.sigstore.dev/auth" ) ) ;
1172+ }
11471173 }
11481174 if self . ctlog_target . is_some ( ) {
11491175 if self . ctlog_uri . is_none ( ) {
0 commit comments