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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a043cafa57aad32acfda37495a8419b4511581786620049cb6264a05265aefb
4
- data.tar.gz: 2c3b66dd69faaef351e043b10c62f3cfd7662e003905363db6bdbf458bfb10b1
3
+ metadata.gz: 4f0687ac3651feaafae6addd37de84cf36bc0b39b25bb9e476ae20cc58c88c83
4
+ data.tar.gz: 0dcfa1a76303b6502a9ce22eb74d62c80070b3a859fd0f61a88cfdff91e6cc16
5
5
  SHA512:
6
- metadata.gz: 677a496c74235ea213ac92416b9dfb303e56bc04ea94b617134925ce744c25bd81583b2516a342c347a935959795c35813245499efcf2c058b075d308ef51454
7
- data.tar.gz: ef42dd385a24ff73526e8e2d21fedb0af60832444f9d1e43c0c23a1cca58da61751a24901430abf0650cffacdd7b41ff28fa7620deb195ede7081af504eb4295
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@v4
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@v3
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@v3
94
+ uses: github/codeql-action/analyze@v4
95
95
  with:
96
96
  category: "/language:${{matrix.language}}"
@@ -1,13 +1,14 @@
1
- name: Rubocop
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@v4
11
+ - uses: actions/checkout@v7
11
12
  - name: Set up Ruby
12
13
  uses: ruby/setup-ruby@v1
13
14
  with:
@@ -1,4 +1,4 @@
1
- name: Ruby
1
+ name: Test
2
2
 
3
3
  on: [push, pull_request]
4
4
 
@@ -16,7 +16,7 @@ jobs:
16
16
  - '3.2'
17
17
  - '3.1'
18
18
  steps:
19
- - uses: actions/checkout@v4
19
+ - uses: actions/checkout@v7
20
20
 
21
21
  - name: Set up Ruby
22
22
  uses: ruby/setup-ruby@v1
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # JIRA API Gem
2
2
 
3
- [![Build Status](https://github.com/sumoheavy/jira-ruby/actions/workflows/CI.yml/badge.svg)](https://github.com/sumoheavy/jira-ruby/actions/workflows/CI.yml)
3
+ [![Build Status](https://github.com/sumoheavy/jira-ruby/actions/workflows/test.yml/badge.svg)](https://github.com/sumoheavy/jira-ruby/actions/workflows/test.yml)
4
+ [![CodeQL](https://github.com/sumoheavy/jira-ruby/actions/workflows/codeql.yml/badge.svg)](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
@@ -396,6 +396,7 @@ module JIRA
396
396
  else
397
397
  hash.each do |k, v|
398
398
  if v.is_a?(Hash)
399
+ target[k] = {} unless target[k].is_a?(Hash)
399
400
  set_attrs(v, clobber, target[k])
400
401
  else
401
402
  target[k] = v
data/lib/jira/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JIRA
4
- VERSION = '3.2.0'
4
+ VERSION = '3.2.1'
5
5
  end
@@ -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 * 10) # 10 years of leeway -- the JWT gem verifies the token expiry time
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
- json_tests = File.read(File.expand_path('../../data/files/jwt-signed-urls.json', File.dirname(__FILE__)))
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
- test_data = JSON.parse(json_tests)
37
- shared_secret = test_data['secret']
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
- test_data['tests'].each do |test|
40
- signed_url = test['signedUrl']
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
- it "#{test['name']} - Canonical URL" do
45
- canonical_uri = described_class.create_canonical_request(signed_url, 'GET', base_url)
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
- # Remote the jwt query param from the signed URL to get the original
48
- expect(canonical_uri).to eq test['canonicalUrl']
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
- decoded_token = JWT.decode(token, shared_secret, true, jwt_opts).first
53
+ decoded_token = JWT.decode(token, shared_secret, true, jwt_opts).first
55
54
 
56
- expect(expected_qsh).to eq decoded_token['qsh']
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
@@ -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.0
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-05-20 00:00:00.000000000 Z
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/rubocop.yml"
92
+ - ".github/workflows/lint.yml"
93
+ - ".github/workflows/test.yml"
94
94
  - ".gitignore"
95
95
  - ".rubocop.yml"
96
96
  - ".yardopts"