@@ -3,7 +3,7 @@ use std::time::Duration;
3
3
use crate :: pe:: StubParameters ;
4
4
5
5
use super :: LanzabooteSigner ;
6
- use anyhow:: { Context , Result } ;
6
+ use anyhow:: { bail , Context , Result } ;
7
7
use serde:: { Deserialize , Serialize } ;
8
8
use ureq:: { Agent , AgentBuilder } ;
9
9
use url:: Url ;
@@ -57,6 +57,10 @@ impl RemoteSigningServer {
57
57
/// If the remote server agrees on providing that stub
58
58
/// It will return it signed.
59
59
fn request_signature ( & self , stub_parameters : & StubParameters ) -> Result < Vec < u8 > > {
60
+ if !stub_parameters. all_signables_in_store ( ) {
61
+ bail ! ( "Signable stub parameters contains non-Nix store paths, the remote server cannot sign that!" ) ;
62
+ }
63
+
60
64
let response = self
61
65
. client
62
66
. post ( self . server_url . join ( "/sign-stub" ) ?. as_str ( ) )
@@ -166,6 +170,10 @@ impl LanzabooteSigner for RemoteSigningServer {
166
170
Ok ( binary)
167
171
}
168
172
173
+ fn can_sign_stub ( & self , stub : & StubParameters ) -> bool {
174
+ stub. all_signables_in_store ( )
175
+ }
176
+
169
177
fn build_and_sign_stub ( & self , stub : & StubParameters ) -> Result < Vec < u8 > > {
170
178
self . request_signature ( stub)
171
179
}
0 commit comments