hephaestus 0.8.15 → 0.8.15.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/hephaestus/engine.rb +24 -2
- data/lib/hephaestus/version.rb +1 -1
- data/templates/lib/schemas/api/2023-03-06/paths/app.json +0 -13
- data/templates/test/fixtures/files/access_token/invalid.json +3 -0
- data/templates/test/fixtures/files/access_token/valid.json +8 -0
- data/templates/test/support/webmocks/app_webmock.rb.tt +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa61f629853ae6077fb808aa81025cfc2e4565c6902da1fb36083588b8dcface
|
4
|
+
data.tar.gz: b5b0ee9106c2517659270e05a87f71e1628d03e8b72563911d3e0cd2782ca151
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66f4fe76c20903f43fed9d2c39bda5f138b966594ded5447cee51088d192c6213debd1113fc85ab7c889d9090536fc2ac0e8758cfd939cb9b467d44a2f75e33a
|
7
|
+
data.tar.gz: 27e94c59c45159d5df1dedd70e2c05f730bb90292bc49701888966662332a192820681aaafcfdfa6ea3245fae233c3b87a411d2b2024c0bb73d5c581859d1fff
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# [v0.8.15.2] - 16-01-2025
|
2
|
+
**Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.8.15.1...v0.8.15.2
|
3
|
+
# [v0.8.15.1] - 16-01-2025
|
4
|
+
## What's Changed
|
5
|
+
* Bugfixes by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/107
|
6
|
+
|
7
|
+
|
8
|
+
**Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.8.15...v0.8.15.1
|
1
9
|
# [v0.8.15] - 15-01-2025
|
2
10
|
## What's Changed
|
3
11
|
* Move hephaestus' plug scripts to subfolder + other fixups by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/104
|
data/lib/hephaestus/engine.rb
CHANGED
@@ -70,8 +70,30 @@ module Hephaestus
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def op_read(label)
|
73
|
-
|
74
|
-
|
73
|
+
if within_op_rate_limit?
|
74
|
+
%x(#{include_sudo?}op read "#{label}").chomp.tap do
|
75
|
+
Rails.logger.error("Failed to fetch `#{label}` from 1Password") && return unless $CHILD_STATUS.success?
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def within_op_rate_limit?
|
81
|
+
return true if Rails.env.local?
|
82
|
+
|
83
|
+
results = %x(#{include_sudo?}op service-account ratelimit --format=json).chomp.tap do |_result|
|
84
|
+
unless $CHILD_STATUS.success?
|
85
|
+
Rails.logger.error("Failed to retrieve rate limits")
|
86
|
+
return false
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
JSON.parse(results).each do |result|
|
91
|
+
if result["remaining"] < 20
|
92
|
+
Rails.logger.error("You're wildly close to the end of your OP rate limits! Check for problems. I can't continue.")
|
93
|
+
false
|
94
|
+
else
|
95
|
+
true
|
96
|
+
end
|
75
97
|
end
|
76
98
|
end
|
77
99
|
|
data/lib/hephaestus/version.rb
CHANGED
@@ -18,19 +18,6 @@
|
|
18
18
|
"schema": {
|
19
19
|
"$ref": "../components/schemas/plug.json#/something"
|
20
20
|
}
|
21
|
-
},
|
22
|
-
"example": {
|
23
|
-
"message": {
|
24
|
-
"text_content": "Hello _World_",
|
25
|
-
"is_public": true,
|
26
|
-
"author": {
|
27
|
-
"name": "John Doe"
|
28
|
-
},
|
29
|
-
"metadata": {}
|
30
|
-
},
|
31
|
-
"creator": {
|
32
|
-
"id": "usr_1234567890"
|
33
|
-
}
|
34
21
|
}
|
35
22
|
}
|
36
23
|
},
|
@@ -16,7 +16,7 @@ module Webmocks
|
|
16
16
|
|
17
17
|
# sig { params(state: String, valid: T::Boolean, status: Integer).returns(T.untyped) }
|
18
18
|
# def stub_request_user_access_token(state, valid: true, status: 200)
|
19
|
-
# response_body = JSON.parse(file_fixture_path("
|
19
|
+
# response_body = JSON.parse(file_fixture_path("access_token", valid ? "valid.json" : "invalid.json").read).deep_symbolize_keys
|
20
20
|
# stub_request(:post, "https://github.com/login/oauth/access_token?#{token_query_params(state)}")
|
21
21
|
# .to_return(
|
22
22
|
# status: status,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hephaestus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.15
|
4
|
+
version: 0.8.15.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootsnap
|
@@ -529,6 +529,8 @@ files:
|
|
529
529
|
- templates/test/controllers/root_controller_test.rb
|
530
530
|
- templates/test/controllers/settings_controller_test.rb.tt
|
531
531
|
- templates/test/controllers/yetto_controller_test.rb
|
532
|
+
- templates/test/fixtures/files/access_token/invalid.json
|
533
|
+
- templates/test/fixtures/files/access_token/valid.json
|
532
534
|
- templates/test/fixtures/files/fake_pem_file/fake.pem
|
533
535
|
- templates/test/fixtures/files/plug_installation_settings/invalid.json
|
534
536
|
- templates/test/fixtures/files/plug_installation_settings/valid.json
|