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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b9b83098b7e947b7591062fdf5068efdb7386672a84600eb35f1ad4f8752a51
4
- data.tar.gz: db98220fe18dd9d65e4ac4ccc1757c96a897431dff6f6d6cafecab37d853997a
3
+ metadata.gz: 6cd2369d4ed24429aebb748f3c8525312c91bf740dcf366669bc858a8bf6b517
4
+ data.tar.gz: 3758c3c03c5afaf27fcb0388e27b5bc0c0168d121a647ccff7d9a7c294e23188
5
5
  SHA512:
6
- metadata.gz: 3a359c8a0c630e1e04fe4c2bd6a317c98b1f6f135001494153a1883e13189d1c9e064eb7d6172c6e21029c69c571eb918f4a47cc77eda32bd2d2193f90a3add3
7
- data.tar.gz: c557900b44619844163796640115a0d58ce4849a6c471b0351d44eb31c8503abe9b0a03e6b2480cfe51d3971107bea88299171d9b3b0c93779aaaa341ff84743
6
+ metadata.gz: f80d75f40cf8ae8d2a1651b995ceef40e1e6056a9d6eb64146e8c5a0fd54edfccc7364a1cb401b2c14ba2fdd4103e2d9af8f7b2d756ebcaf651d638b9fd71772
7
+ data.tar.gz: 5f50da3541c6fc7ebd502fed79207255bb85765191f2a56e82fc20d71936925fef573690e96eaf56305d035ea594d965317cbcfef2e8c4ca83e57d7b2b152523
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.0.13] - 2025-05-07
2
+
3
+ - Change :authenticate_with_header to be shorter and a tuple
4
+
1
5
  ## [0.0.12] - 2025-05-05
2
6
 
3
7
  - Add AuthenticatedRemoteCommand
@@ -3,18 +3,18 @@ require_relative "remote_command"
3
3
  module Foobara
4
4
  class AuthenticatedRemoteCommand < RemoteCommand
5
5
  class << self
6
- attr_accessor :authenticate_with_header_name, :authenticate_with_header_value
6
+ attr_accessor :auth_header_name, :auth_header_value
7
7
 
8
- def subclass(authenticate_with_header:, **opts)
8
+ def subclass(auth_header:, **opts)
9
9
  super(base: AuthenticatedRemoteCommand, **opts).tap do |klass|
10
- klass.authenticate_with_header_name = authenticate_with_header[:name]
11
- klass.authenticate_with_header_value = authenticate_with_header[:value]
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.authenticate_with_header_value
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.authenticate_with_header_name => value)
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
- authenticate_with_header :allow_nil do
14
- name :string, :required, "The header name to set"
15
- value :duck, :required, "A string value or proc that returns a string value"
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!(authenticate_with_header:)
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
- authenticate_with_header
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.12
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-06 00:00:00.000000000 Z
10
+ date: 2025-05-08 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foobara