rex-random_identifier 0.1.6 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c9571d3505cd046a46dd18a365270c8cac23425efd11982b1f13a4b5c7ccda5
4
- data.tar.gz: e576c1de9555bf1cdc8bbe1a3e62ede10df0fbccdfc8def25d6ffc58eedb647a
3
+ metadata.gz: 5bebd9aaae44f450ed7fce4a510496c03ad9dd3ae817a53c0a971bee7d053231
4
+ data.tar.gz: d4f25e635ea34259fadcee150dedc3b76d86f5e3cf3278687d9941751773bc3e
5
5
  SHA512:
6
- metadata.gz: 352a8c6c761fff3603895df1e681b4c4160443d4f377b5955c74466a17c178bafd5ed7159bec66d6359915dee5dd08b397c2bd4ff665d6fbb7d63b91836b1ee7
7
- data.tar.gz: d79da21e1917a9938e429e818e4bfea57a408de2475bf2ad216d4afe4ac1325f84896f0de1a47bfaebd5eed562204e050e9c38a9614d769383be9bfd370c2a39
6
+ metadata.gz: 1369b96dec5266f98ff8441ff51e715787217886d1b2847ca821cd42a188e2ed74448b1393444c3747667ee513400cb6df62435044450a01d16aca734378ace6
7
+ data.tar.gz: 4455996738dfd4498fe184c0de0ca6dee9287d2557a53f11b65c6991fd1f68aa0ddd0e60215d9f1eb6aadca412d2db2709eb9dddb07ca121dc01cb667fcf9bd5
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1 @@
1
- >)s~3x d�� ]5��'3���i?���]jIQV5��]��2,��a.�M��T��Y��K��
2
- ��@ �;Z;��.8r��Dɔ��K�I:�H�)bGL.1�� 3ܤ @a���WX̀klS�%Ymzjt�s�`F��2z�O�Z䗾�{��<L7�ZOX�ɻ,�䁗�4m��]l <������|�O\��S����w|�$Z�ެŧn�����|U�0�XmC�~X�+�n�0L�xK2�0@
1
+ |��+��#NA��#n��LHN�ʅ�N2����4����J���ɬ� �;'U��'j��•pC�!v3����jK�:w�Y��Q�-��"L7sf��\��V_P�j�����fW��}� �<�$�����~i _W���===�+K7����gd�N�������ωql�*:���i��x�KK%���c��ш�pa�0D.U.�[��xP#��rwj��I> ��uy�[u�X�]�V��z��$~1�
@@ -10,45 +10,39 @@ on:
10
10
 
11
11
  jobs:
12
12
  test:
13
- runs-on: ubuntu-18.04
13
+ runs-on: ${{ matrix.os }}
14
14
  timeout-minutes: 40
15
15
 
16
16
  strategy:
17
17
  fail-fast: true
18
18
  matrix:
19
19
  ruby:
20
- - 2.5
21
- - 2.6
22
20
  - 2.7
23
21
  - 3.0
22
+ - 3.1
23
+ os:
24
+ - ubuntu-20.04
25
+ - ubuntu-latest
26
+ exclude:
27
+ - { os: ubuntu-latest, ruby: 2.7 }
28
+ - { os: ubuntu-latest, ruby: 3.0 }
24
29
  test_cmd:
25
30
  - bundle exec rspec
26
31
 
27
32
  env:
28
33
  RAILS_ENV: test
29
34
 
30
- name: Ruby ${{ matrix.ruby }} - ${{ matrix.test_cmd }}
35
+ name: ${{ matrix.os }} - Ruby ${{ matrix.ruby }} - ${{ matrix.test_cmd }}
31
36
  steps:
32
37
  - name: Checkout code
33
38
  uses: actions/checkout@v2
34
39
 
35
- - uses: actions/setup-ruby@v1
40
+ - name: Setup Ruby
41
+ uses: ruby/setup-ruby@v1
36
42
  with:
37
43
  ruby-version: ${{ matrix.ruby }}
44
+ bundler-cache: true
38
45
 
39
- - name: Setup bundler
40
- run: |
41
- gem install bundler
42
- - uses: actions/cache@v2
43
- with:
44
- path: vendor/bundle
45
- key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
46
- restore-keys: |
47
- ${{ runner.os }}-gems-
48
- - name: Bundle install
49
- run: |
50
- bundle config path vendor/bundle
51
- bundle install --jobs 4 --retry 3
52
46
  - name: ${{ matrix.test_cmd }}
53
47
  run: |
54
48
  echo "${CMD}"
@@ -34,10 +34,42 @@ class Rex::RandomIdentifier::Generator
34
34
  # This should be pretty universal for identifier rules
35
35
  :char_set => Rex::Text::AlphaNumeric+"_",
36
36
  :first_char_set => Rex::Text::LowerAlpha,
37
- :forbidden => []
37
+ :forbidden => [].freeze
38
+ }
39
+
40
+ JavaOpts = DefaultOpts.merge(
41
+ forbidden: (
42
+ DefaultOpts[:forbidden] +
43
+ %w[
44
+ abstract assert boolean break byte case catch char class const
45
+ continue default do double else enum extends false final finally
46
+ float for goto if implements import instanceof int interface long
47
+ native new null package private protected public return short
48
+ static strictfp super switch synchronized this throw throws
49
+ transient true try void volatile while _
50
+ ]
51
+ ).uniq.freeze
52
+ )
53
+
54
+ JSPOpts = JavaOpts.merge(
55
+ forbidden: (
56
+ JavaOpts[:forbidden] +
57
+ # Reserved Words for Implicit Objects
58
+ # https://docs.oracle.com/cd/E13222_01/wls/docs90/webapp/reference.html#66991
59
+ %w[
60
+ application config out page pageContext request response session var
61
+ ]
62
+ ).uniq.freeze
63
+ )
64
+
65
+ Opts = {
66
+ default: DefaultOpts,
67
+ java: JavaOpts,
68
+ jsp: JSPOpts
38
69
  }
39
70
 
40
71
  # @param opts [Hash] Options, see {DefaultOpts} for default values
72
+ # @option opts :language [Symbol] See the {Opts} keys for supported languages
41
73
  # @option opts :max_length [Fixnum]
42
74
  # @option opts :min_length [Fixnum]
43
75
  # @option opts :char_set [String]
@@ -49,7 +81,12 @@ class Rex::RandomIdentifier::Generator
49
81
  # having to search through the whole list of values
50
82
  @name_by_value = {}
51
83
 
52
- @opts = DefaultOpts.merge(opts)
84
+ language = opts[:language] || :default
85
+ unless Opts.has_key?(language)
86
+ raise ArgumentError, "Language option #{language} is not supported. Expected one of #{Opts.keys}"
87
+ end
88
+ @opts = Opts[language]
89
+ @opts = @opts.merge(opts)
53
90
  if @opts[:min_length] < 1 || @opts[:max_length] < 1 || @opts[:max_length] < @opts[:min_length]
54
91
  raise ArgumentError, "Invalid length options"
55
92
  end
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module RandomIdentifier
3
- VERSION = "0.1.6"
3
+ VERSION = "0.1.9"
4
4
  end
5
5
  end
data.tar.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- ,�
2
- Pĝvly�#�� f�=�:&���˭�!���M Ы_���4�:�׬~��?F*M�r/<�!;��;�H��$v\����T����$�����z{�����5�h�ܿ�����wҕ7 �m�&�>��d�5b�Am|O?��x
3
- �:ꈹ�*�_���b��{�in��[����-�kĠ('����v�&x35:��~���X��p4j�� �ec�]����W C�Ը
1
+ �IN�zav|����x�鈑 dυ��a�
2
+ +v�
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rex-random_identifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
@@ -93,7 +93,7 @@ cert_chain:
93
93
  EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
94
94
  9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
95
95
  -----END CERTIFICATE-----
96
- date: 2021-07-19 00:00:00.000000000 Z
96
+ date: 2022-09-02 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
Binary file