foobara-auth-http 0.0.1 → 0.0.2

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: a3eacebdbdf0033c04a80f6c4945fefa4596d7b2d1a718f27d66823bccf5dc56
4
- data.tar.gz: 1959f5e331a4d54df31e0886e5bec47d2e50b032a5797a4668ec8c930aab589c
3
+ metadata.gz: c78d6fc15e3b6a271b9e0121cace66c9ea10ebbcc5b2d52700c0c425a146df05
4
+ data.tar.gz: 4c786b7908265323485e73400d782bf68a401ba7b552de2b15beb6b43fe407bb
5
5
  SHA512:
6
- metadata.gz: 67b39d5e7e4fc4f202d0cb8f6138d3aaeff5e305c19bfcec08f610f2321d332e8a26d477087d619694f02ffca6216c1ae0f15785003bb9b56da7bde82f330769
7
- data.tar.gz: 457331b3b96ece885d98aba3e83422b4d986e34e813f4cf8493fcb0953b599748bef6b2b36b1b5f533ab9dc035feb057827d6dab65a13ddb8b8174481d161622
6
+ metadata.gz: 89367ef8990d6f353234e85a4373173a2da3be0e4e041ad6b9f666c6b1a91b1e6d98d336cd1186c511ed1ce480f9935dcbd7658529f24194b3065148e6e93038
7
+ data.tar.gz: bb9df4f89ae8347cbac0c53a5b7475d915c77ff8809cb57c18a850aec22c26f4464e7f9ffa242bc77ba085bd958456ca7dc1edb5eb782f34dc0c28841a3019d8
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## [0.0.1]
1
+ ## [0.0.2] - 2025-04-22
2
+
3
+ - Add several helpful request/response mutators
4
+
5
+ ## [0.0.1]- 2025-04-22
2
6
 
3
7
  - Initial release
4
8
 
@@ -0,0 +1,19 @@
1
+ module Foobara
2
+ module AuthHttp
3
+ class ClearAccessTokenHeader < Foobara::CommandConnectors::Http::SetHeader
4
+ # TODO: move this into base class as default?
5
+ class << self
6
+ def requires_declaration_data?
7
+ false
8
+ end
9
+ end
10
+
11
+ def initialize(header_name = "X-Access-Token", header_value = nil)
12
+ super()
13
+
14
+ self.header_name = header_name
15
+ self.header_value = header_value
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ module Foobara
2
+ module AuthHttp
3
+ class MoveAccessTokenToHeader < Foobara::CommandConnectors::Http::MoveAttributeToHeader
4
+ # TODO: move this into base class as default?
5
+ class << self
6
+ def requires_declaration_data?
7
+ false
8
+ end
9
+ end
10
+
11
+ def initialize(attribute_name = :access_token, header_name = "X-Access-Token")
12
+ super()
13
+
14
+ self.attribute_name = attribute_name
15
+ self.header_name = header_name
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,25 @@
1
+ module Foobara
2
+ module AuthHttp
3
+ class MoveRefreshTokenToCookie < Foobara::CommandConnectors::Http::MoveAttributeToCookie
4
+ # TODO: move this into base class as default?
5
+ class << self
6
+ def requires_declaration_data?
7
+ false
8
+ end
9
+ end
10
+
11
+ def initialize(attribute_name = :refresh_token, cookie_name = attribute_name, **cookie_opts)
12
+ super()
13
+
14
+ self.attribute_name = attribute_name
15
+ self.cookie_name = cookie_name
16
+ self.cookie_opts = {
17
+ httponly: true,
18
+ path: "/run/Foobara/Auth/",
19
+ secure: ENV["FOOBARA_ENV"] != "development" && ENV["FOOBARA_ENV"] != "test",
20
+ same_site: :strict
21
+ }.merge(cookie_opts)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,19 @@
1
+ module Foobara
2
+ module AuthHttp
3
+ class SetRefreshTokenFromCookie < Foobara::CommandConnectors::Http::SetInputFromCookie
4
+ # TODO: move this into base class as default?
5
+ class << self
6
+ def requires_declaration_data?
7
+ false
8
+ end
9
+ end
10
+
11
+ def initialize(attribute_name = :refresh_token, cookie_name = attribute_name)
12
+ super()
13
+
14
+ self.attribute_name = attribute_name
15
+ self.cookie_name = cookie_name
16
+ end
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-auth-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
@@ -65,6 +65,10 @@ files:
65
65
  - lib/foobara/auth_http.rb
66
66
  - src/foobara/auth_http.rb
67
67
  - src/foobara/auth_http/bearer_authenticator.rb
68
+ - src/foobara/auth_http/clear_access_token_header.rb
69
+ - src/foobara/auth_http/move_access_token_to_header.rb
70
+ - src/foobara/auth_http/move_refresh_token_to_cookie.rb
71
+ - src/foobara/auth_http/set_refresh_token_from_cookie.rb
68
72
  homepage: https://github.com/foobara/auth-http
69
73
  licenses:
70
74
  - Apache-2.0 OR MIT