foobara-remote-imports 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/src/foobara/authenticated_remote_command.rb +6 -6
- data/src/foobara/remote_imports/import_command.rb +5 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cd2369d4ed24429aebb748f3c8525312c91bf740dcf366669bc858a8bf6b517
|
4
|
+
data.tar.gz: 3758c3c03c5afaf27fcb0388e27b5bc0c0168d121a647ccff7d9a7c294e23188
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f80d75f40cf8ae8d2a1651b995ceef40e1e6056a9d6eb64146e8c5a0fd54edfccc7364a1cb401b2c14ba2fdd4103e2d9af8f7b2d756ebcaf651d638b9fd71772
|
7
|
+
data.tar.gz: 5f50da3541c6fc7ebd502fed79207255bb85765191f2a56e82fc20d71936925fef573690e96eaf56305d035ea594d965317cbcfef2e8c4ca83e57d7b2b152523
|
data/CHANGELOG.md
CHANGED
@@ -3,18 +3,18 @@ require_relative "remote_command"
|
|
3
3
|
module Foobara
|
4
4
|
class AuthenticatedRemoteCommand < RemoteCommand
|
5
5
|
class << self
|
6
|
-
attr_accessor :
|
6
|
+
attr_accessor :auth_header_name, :auth_header_value
|
7
7
|
|
8
|
-
def subclass(
|
8
|
+
def subclass(auth_header:, **opts)
|
9
9
|
super(base: AuthenticatedRemoteCommand, **opts).tap do |klass|
|
10
|
-
klass.
|
11
|
-
klass.
|
10
|
+
klass.auth_header_name = auth_header[0]
|
11
|
+
klass.auth_header_value = auth_header[1]
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
def build_request_headers
|
17
|
-
value = self.class.
|
17
|
+
value = self.class.auth_header_value
|
18
18
|
|
19
19
|
if value.is_a?(Proc)
|
20
20
|
value = if value.lambda? && value.arity == 0
|
@@ -24,7 +24,7 @@ module Foobara
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
self.request_headers = super.merge(self.class.
|
27
|
+
self.request_headers = super.merge(self.class.auth_header_name => value)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -10,10 +10,9 @@ module Foobara
|
|
10
10
|
|
11
11
|
add_inputs do
|
12
12
|
base_command_class :duck, :allow_nil
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
13
|
+
auth_header :tuple,
|
14
|
+
element_type_declarations: [:string, :duck],
|
15
|
+
description: "A header name, header value/proc pair."
|
17
16
|
end
|
18
17
|
|
19
18
|
depends_on ImportDomain, ImportType, ImportError
|
@@ -88,7 +87,7 @@ module Foobara
|
|
88
87
|
}
|
89
88
|
|
90
89
|
if determine_base_command_class == AuthenticatedRemoteCommand
|
91
|
-
subclass_args.merge!(
|
90
|
+
subclass_args.merge!(auth_header:)
|
92
91
|
end
|
93
92
|
|
94
93
|
determine_base_command_class.subclass(**subclass_args)
|
@@ -98,7 +97,7 @@ module Foobara
|
|
98
97
|
@determine_base_command_class ||= if base_command_class
|
99
98
|
base_command_class
|
100
99
|
elsif manifest_to_import.requires_authentication? &&
|
101
|
-
|
100
|
+
auth_header
|
102
101
|
AuthenticatedRemoteCommand
|
103
102
|
else
|
104
103
|
RemoteCommand
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foobara-remote-imports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-05-
|
10
|
+
date: 2025-05-08 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: foobara
|