jira-ruby 3.2.0 → 3.2.1
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/.github/workflows/codeql.yml +3 -3
- data/.github/workflows/{rubocop.yml → lint.yml} +3 -2
- data/.github/workflows/{CI.yml → test.yml} +2 -2
- data/README.md +2 -1
- data/lib/jira/base.rb +1 -0
- data/lib/jira/version.rb +1 -1
- data/spec/jira/atlassian/jwt_spec.rb +19 -20
- data/spec/jira/base_spec.rb +21 -0
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4f0687ac3651feaafae6addd37de84cf36bc0b39b25bb9e476ae20cc58c88c83
|
|
4
|
+
data.tar.gz: 0dcfa1a76303b6502a9ce22eb74d62c80070b3a859fd0f61a88cfdff91e6cc16
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a41e5b87a3f9854a8bdebef3fcf5127d25ba00afe7a7c35e223c9de311004d50351eafd0437f3e8901a792b5cfbfc7a318cf55ec1c8faa32dd4e8180c286700
|
|
7
|
+
data.tar.gz: 953c1f03222337d49f0c5868c25ab226a1bbdef70f5b09063cfec6f90a0eb9d01b1f96de5f606b02d58d88f33c648738d2d640c77550f85ad4f705e9c929db14
|
|
@@ -60,11 +60,11 @@ jobs:
|
|
|
60
60
|
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
|
61
61
|
steps:
|
|
62
62
|
- name: Checkout repository
|
|
63
|
-
uses: actions/checkout@
|
|
63
|
+
uses: actions/checkout@v7
|
|
64
64
|
|
|
65
65
|
# Initializes the CodeQL tools for scanning.
|
|
66
66
|
- name: Initialize CodeQL
|
|
67
|
-
uses: github/codeql-action/init@
|
|
67
|
+
uses: github/codeql-action/init@v4
|
|
68
68
|
with:
|
|
69
69
|
languages: ${{ matrix.language }}
|
|
70
70
|
build-mode: ${{ matrix.build-mode }}
|
|
@@ -91,6 +91,6 @@ jobs:
|
|
|
91
91
|
exit 1
|
|
92
92
|
|
|
93
93
|
- name: Perform CodeQL Analysis
|
|
94
|
-
uses: github/codeql-action/analyze@
|
|
94
|
+
uses: github/codeql-action/analyze@v4
|
|
95
95
|
with:
|
|
96
96
|
category: "/language:${{matrix.language}}"
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: Lint
|
|
2
2
|
|
|
3
3
|
on: [push, pull_request]
|
|
4
4
|
|
|
5
5
|
jobs:
|
|
6
6
|
rubocop:
|
|
7
|
+
name: Lint
|
|
7
8
|
runs-on: ubuntu-latest
|
|
8
9
|
|
|
9
10
|
steps:
|
|
10
|
-
- uses: actions/checkout@
|
|
11
|
+
- uses: actions/checkout@v7
|
|
11
12
|
- name: Set up Ruby
|
|
12
13
|
uses: ruby/setup-ruby@v1
|
|
13
14
|
with:
|
data/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# JIRA API Gem
|
|
2
2
|
|
|
3
|
-
[](https://github.com/sumoheavy/jira-ruby/actions/workflows/test.yml)
|
|
4
|
+
[](https://github.com/sumoheavy/jira-ruby/actions/workflows/codeql.yml)
|
|
4
5
|
|
|
5
6
|
This gem provides access to the Atlassian JIRA REST API.
|
|
6
7
|
|
data/lib/jira/base.rb
CHANGED
data/lib/jira/version.rb
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
# rubocop:disable RSpec/LeakyLocalVariable
|
|
4
3
|
describe JIRA::Atlassian::Jwt do
|
|
5
4
|
let(:jwt_opts) do
|
|
6
5
|
{
|
|
7
6
|
algorithm: 'HS256',
|
|
8
|
-
leeway: (3600 * 24 * 365 *
|
|
7
|
+
leeway: (3600 * 24 * 365 * 20) # 10 years of leeway -- the JWT gem verifies the token expiry time
|
|
9
8
|
}
|
|
10
9
|
end
|
|
11
10
|
let(:base_url) { '' }
|
|
11
|
+
let(:shared_secret) { TEST_DATA['secret'] }
|
|
12
12
|
|
|
13
13
|
it 'generates claims' do
|
|
14
14
|
url = 'https://example.atlassian.com/jira/projects'
|
|
@@ -31,30 +31,29 @@ describe JIRA::Atlassian::Jwt do
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
# Offical Atlassian signed URL test data
|
|
34
|
-
|
|
34
|
+
TEST_DATA = JSON.parse(
|
|
35
|
+
File.read(File.expand_path('../../data/files/jwt-signed-urls.json', File.dirname(__FILE__)))
|
|
36
|
+
).freeze
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
TEST_DATA['tests'].each do |test|
|
|
39
|
+
context test['name'] do
|
|
40
|
+
let(:signed_url) { test['signedUrl'] }
|
|
41
|
+
let(:token) { CGI.parse(URI.parse(signed_url).query)['jwt'].first }
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
signed_uri = URI.parse(signed_url)
|
|
42
|
-
token = CGI.parse(signed_uri.query)['jwt'].first
|
|
43
|
+
it 'builds the canonical URL' do
|
|
44
|
+
canonical_uri = described_class.create_canonical_request(signed_url, 'GET', base_url)
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
# Remote the jwt query param from the signed URL to get the original
|
|
47
|
+
expect(canonical_uri).to eq test['canonicalUrl']
|
|
48
|
+
end
|
|
46
49
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
it "#{test['name']} - QSH match" do
|
|
52
|
-
expected_qsh = Digest::SHA256.hexdigest(described_class.create_canonical_request(signed_url, 'GET', base_url))
|
|
50
|
+
it 'matches the qsh claim' do
|
|
51
|
+
expected_qsh = Digest::SHA256.hexdigest(described_class.create_canonical_request(signed_url, 'GET', base_url))
|
|
53
52
|
|
|
54
|
-
|
|
53
|
+
decoded_token = JWT.decode(token, shared_secret, true, jwt_opts).first
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
expect(expected_qsh).to eq decoded_token['qsh']
|
|
56
|
+
end
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
|
-
# rubocop:enable RSpec/LeakyLocalVariable
|
data/spec/jira/base_spec.rb
CHANGED
|
@@ -339,6 +339,27 @@ describe JIRA::Base do
|
|
|
339
339
|
subject.set_attrs({ 'foo' => { 'fum' => 'dum' } }, false)
|
|
340
340
|
expect(subject.foo).to eq('bar' => 'baz', 'fum' => 'dum')
|
|
341
341
|
end
|
|
342
|
+
|
|
343
|
+
it 'creates missing intermediate hashes instead of merging into the top level when clobber is false' do
|
|
344
|
+
subject.attrs = { 'id' => '10500', 'key' => 'REL-77', 'fields' => { 'summary' => 'x' } }
|
|
345
|
+
subject.set_attrs({ 'fields' => { 'project' => { 'key' => 'REL' } } }, false)
|
|
346
|
+
expect(subject.attrs['key']).to eq('REL-77')
|
|
347
|
+
expect(subject.attrs['fields']['project']['key']).to eq('REL')
|
|
348
|
+
expect(subject.attrs['fields']['summary']).to eq('x')
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
it 'deeply merges into an existing nested hash when clobber is false' do
|
|
352
|
+
subject.attrs = { 'fields' => { 'project' => { 'id' => '10000' }, 'summary' => 'x' } }
|
|
353
|
+
subject.set_attrs({ 'fields' => { 'project' => { 'key' => 'REL' } } }, false)
|
|
354
|
+
expect(subject.attrs['fields']['project']).to eq('id' => '10000', 'key' => 'REL')
|
|
355
|
+
expect(subject.attrs['fields']['summary']).to eq('x')
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
it 'replaces a non-hash value with the new hash when clobber is false' do
|
|
359
|
+
subject.attrs = { 'fields' => { 'project' => 'REL' } }
|
|
360
|
+
subject.set_attrs({ 'fields' => { 'project' => { 'key' => 'REL' } } }, false)
|
|
361
|
+
expect(subject.attrs['fields']['project']).to eq('key' => 'REL')
|
|
362
|
+
end
|
|
342
363
|
end
|
|
343
364
|
|
|
344
365
|
describe 'delete' do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jira-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.2.
|
|
4
|
+
version: 3.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SUMO Heavy Industries
|
|
8
8
|
- test IO
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-07-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -88,9 +88,9 @@ files:
|
|
|
88
88
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
|
89
89
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
|
90
90
|
- ".github/dependabot.yml"
|
|
91
|
-
- ".github/workflows/CI.yml"
|
|
92
91
|
- ".github/workflows/codeql.yml"
|
|
93
|
-
- ".github/workflows/
|
|
92
|
+
- ".github/workflows/lint.yml"
|
|
93
|
+
- ".github/workflows/test.yml"
|
|
94
94
|
- ".gitignore"
|
|
95
95
|
- ".rubocop.yml"
|
|
96
96
|
- ".yardopts"
|