@@ -98,6 +98,10 @@ pub struct Install {
9898 #[ clap( long = PLUGIN_OVERRIDE_COMPATIBILITY_CHECK_FLAG , takes_value = false ) ]
9999 pub override_compatibility_check : bool ,
100100
101+ /// Provide the auth header value to be able to install a plugin from a private repository.
102+ #[ clap( long = "auth-header-value" , requires = PLUGIN_REMOTE_PLUGIN_MANIFEST_OPT , env = "SPIN_PLUGIN_AUTH_HEADER_VALUE" ) ]
103+ pub auth_header_value : Option < String > ,
104+
101105 /// Specific version of a plugin to be install from the centralized plugins
102106 /// repository.
103107 #[ clap(
@@ -126,6 +130,7 @@ impl Install {
126130 & manifest_location,
127131 self . override_compatibility_check ,
128132 SPIN_VERSION ,
133+ self . auth_header_value ,
129134 )
130135 . await ?;
131136 try_install (
@@ -207,6 +212,10 @@ pub struct Upgrade {
207212 #[ clap( short = 'y' , long = "yes" , takes_value = false ) ]
208213 pub yes_to_all : bool ,
209214
215+ /// Provide the auth header value to be able to install a plugin from a private repository.
216+ #[ clap( long = "auth-header-value" , requires = PLUGIN_REMOTE_PLUGIN_MANIFEST_OPT , env = "SPIN_PLUGIN_AUTH_HEADER_VALUE" ) ]
217+ pub auth_header_value : Option < String > ,
218+
210219 /// Overrides a failed compatibility check of the plugin with the current version of Spin.
211220 #[ clap( long = PLUGIN_OVERRIDE_COMPATIBILITY_CHECK_FLAG , takes_value = false ) ]
212221 pub override_compatibility_check : bool ,
@@ -288,7 +297,12 @@ impl Upgrade {
288297
289298 // Attempt to get the manifest to check eligibility to upgrade
290299 if let Ok ( manifest) = manager
291- . get_manifest ( & manifest_location, false , SPIN_VERSION )
300+ . get_manifest (
301+ & manifest_location,
302+ false ,
303+ SPIN_VERSION ,
304+ self . auth_header_value ,
305+ )
292306 . await
293307 {
294308 // Check if upgraded candidates have a newer version and if are compatible
@@ -365,6 +379,7 @@ impl Upgrade {
365379 & manifest_location,
366380 self . override_compatibility_check ,
367381 SPIN_VERSION ,
382+ self . auth_header_value ,
368383 )
369384 . await
370385 {
@@ -405,6 +420,7 @@ impl Upgrade {
405420 & manifest_location,
406421 self . override_compatibility_check ,
407422 SPIN_VERSION ,
423+ self . auth_header_value ,
408424 )
409425 . await ?;
410426 try_install (
@@ -434,6 +450,7 @@ impl Show {
434450 & ManifestLocation :: PluginsRepository ( PluginLookup :: new ( & self . name , None ) ) ,
435451 false ,
436452 SPIN_VERSION ,
453+ self . auth_header_value ,
437454 )
438455 . await ?;
439456
@@ -804,7 +821,9 @@ async fn try_install(
804821
805822 let package = manager:: get_package ( manifest) ?;
806823 if continue_to_install ( manifest, package, yes_to_all) ? {
807- let installed = manager. install ( manifest, package, source) . await ?;
824+ let installed = manager
825+ . install ( manifest, package, source, self . auth_header_value )
826+ . await ?;
808827 println ! ( "Plugin '{installed}' was installed successfully!" ) ;
809828
810829 if let Some ( description) = manifest. description ( ) {
0 commit comments