pwn 0.5.467 → 0.5.469
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/README.md +3 -3
- data/lib/pwn/plugins/jira_data_center.rb +56 -26
- data/lib/pwn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a3776d69c2f72f9b607ae0b156d28edf85a3db2270c33623db7af2e1c630f7ca
|
|
4
|
+
data.tar.gz: d57db357712c6670ca2446bf45bba505ac3ec64785bcd4fded78ce6151dc9849
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3e53da8aaf44763a2370452aff6b06601846d69fc41ee91b20115fbba35275af40bfdc95b7d14d39576c19f3e09355bfb4f7e4fd0c3da9309dbb20cf90b2484b
|
|
7
|
+
data.tar.gz: f204e8f4de53b59e8738705a973ed186eebb2fdff72aff0358ac3147d123fd0d75bcdef42a040bcb0a697c21670f5e264e90f37e14971270670f30cec3d6f2f3
|
data/README.md
CHANGED
|
@@ -37,7 +37,7 @@ $ cd /opt/pwn
|
|
|
37
37
|
$ ./install.sh
|
|
38
38
|
$ ./install.sh ruby-gem
|
|
39
39
|
$ pwn
|
|
40
|
-
pwn[v0.5.
|
|
40
|
+
pwn[v0.5.469]:001 >>> PWN.help
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.4.4@pwn
|
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
|
53
53
|
$ gem install --verbose pwn
|
|
54
54
|
$ pwn
|
|
55
|
-
pwn[v0.5.
|
|
55
|
+
pwn[v0.5.469]:001 >>> PWN.help
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
If you're using a multi-user install of RVM do:
|
|
@@ -62,7 +62,7 @@ $ rvm use ruby-3.4.4@pwn
|
|
|
62
62
|
$ rvmsudo gem uninstall --all --executables pwn
|
|
63
63
|
$ rvmsudo gem install --verbose pwn
|
|
64
64
|
$ pwn
|
|
65
|
-
pwn[v0.5.
|
|
65
|
+
pwn[v0.5.469]:001 >>> PWN.help
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
PWN periodically upgrades to the latest version of Ruby which is reflected in `/opt/pwn/.ruby-version`. The easiest way to upgrade to the latest version of Ruby from a previous PWN installation is to run the following script:
|
|
@@ -405,10 +405,12 @@ module PWN
|
|
|
405
405
|
rest_call: "issue/createmeta/#{project_key}/issuetypes/#{issue_type_id}",
|
|
406
406
|
params: params
|
|
407
407
|
)
|
|
408
|
-
max_results = this_resp[:maxResults]
|
|
409
|
-
total = this_resp[:total]
|
|
410
408
|
is_last = this_resp[:isLast]
|
|
411
|
-
response[:
|
|
409
|
+
response[:maxResults] = this_resp[:maxResults]
|
|
410
|
+
response[:startAt] = this_resp[:startAt]
|
|
411
|
+
response[:total] = this_resp[:total]
|
|
412
|
+
response[:isLast] = is_last
|
|
413
|
+
response[:values].concat(this_resp[:values])
|
|
412
414
|
break if is_last
|
|
413
415
|
|
|
414
416
|
start_at += max_results
|
|
@@ -432,40 +434,68 @@ module PWN
|
|
|
432
434
|
|
|
433
435
|
project_key = issue_data[:fields][:project][:key]
|
|
434
436
|
summary = "CLONE - #{issue_data[:fields][:summary]}"
|
|
435
|
-
|
|
436
|
-
issue_type = issue_data[:fields][:issuetype][:name].downcase.to_sym
|
|
437
|
-
issue_type_id = issue_data[:fields][:issuetype][:id]
|
|
438
|
-
|
|
439
|
-
reject_keys = %i[
|
|
440
|
-
project
|
|
441
|
-
summary
|
|
442
|
-
issuetype
|
|
443
|
-
description
|
|
444
|
-
created
|
|
445
|
-
updated
|
|
446
|
-
resolution
|
|
447
|
-
status
|
|
448
|
-
resolutiondate
|
|
449
|
-
environment
|
|
450
|
-
comment
|
|
451
|
-
attachment
|
|
452
|
-
]
|
|
453
|
-
|
|
454
437
|
epic_name = nil
|
|
455
438
|
epic_name_field_key = nil
|
|
456
439
|
if issue_type == :epic
|
|
457
440
|
all_fields = get_all_fields
|
|
458
441
|
epic_name_field_key = all_fields.find { |field| field[:name] == 'Epic Name' }[:id]
|
|
459
442
|
epic_name = issue_data[:fields][epic_name_field_key.to_sym]
|
|
460
|
-
reject_keys << epic_name_field_key.to_sym
|
|
461
443
|
end
|
|
462
444
|
|
|
463
445
|
description = issue_data[:fields][:description]
|
|
464
446
|
|
|
465
|
-
|
|
466
|
-
|
|
447
|
+
# Determine issue type (was previously missing) and create metadata
|
|
448
|
+
issue_type = issue_data[:fields][:issuetype][:name].downcase.to_sym
|
|
449
|
+
issue_type_id = issue_data[:fields][:issuetype][:id]
|
|
450
|
+
|
|
451
|
+
meta = get_issue_type_metadata(
|
|
452
|
+
project_key: project_key,
|
|
453
|
+
issue_type_id: issue_type_id
|
|
454
|
+
)
|
|
455
|
+
candidate_array = meta[:values] ||= []
|
|
456
|
+
|
|
457
|
+
# Build list of fields we can 'set' on create (per create metadata)
|
|
458
|
+
allowed_fields = []
|
|
459
|
+
candidate_array.each do |field_obj|
|
|
460
|
+
next unless field_obj.is_a?(Hash)
|
|
461
|
+
|
|
462
|
+
ops = field_obj[:operations] ||= []
|
|
463
|
+
next unless ops.include?('set')
|
|
464
|
+
|
|
465
|
+
field_key = field_obj[:key] || field_obj[:id] || field_obj[:fieldId]
|
|
466
|
+
next if field_key.nil? || field_key.to_s.empty?
|
|
467
|
+
|
|
468
|
+
allowed_fields.push(field_key.to_s)
|
|
469
|
+
end
|
|
470
|
+
|
|
471
|
+
reserved_fields = %i[project summary issuetype description]
|
|
472
|
+
reserved_fields.push(epic_name_field_key.to_sym) if epic_name_field_key
|
|
473
|
+
|
|
474
|
+
filtered_fields = {}
|
|
475
|
+
issue_data[:fields].each do |k, v|
|
|
476
|
+
next if v.nil?
|
|
477
|
+
|
|
478
|
+
k_str = k.to_s
|
|
479
|
+
next if reserved_fields.include?(k) || reserved_fields.include?(k_str.to_sym)
|
|
480
|
+
|
|
481
|
+
next unless allowed_fields.include?(k_str)
|
|
482
|
+
|
|
483
|
+
case v
|
|
484
|
+
when Array
|
|
485
|
+
filtered_fields[k] = v.map { |elem| elem.is_a?(Hash) ? elem.slice(*%i[id key name value]) : elem }
|
|
486
|
+
when Hash
|
|
487
|
+
filtered_fields[k] =
|
|
488
|
+
if v.keys.any? { |kk| %i[id key name value].include?(kk) }
|
|
489
|
+
v.slice(*%i[id key name value])
|
|
490
|
+
else
|
|
491
|
+
v
|
|
492
|
+
end
|
|
493
|
+
else
|
|
494
|
+
filtered_fields[k] = v
|
|
495
|
+
end
|
|
496
|
+
end
|
|
467
497
|
|
|
468
|
-
additional_fields = { fields:
|
|
498
|
+
additional_fields = { fields: filtered_fields }
|
|
469
499
|
|
|
470
500
|
create_issue(
|
|
471
501
|
project_key: project_key,
|
data/lib/pwn/version.rb
CHANGED