rotp 6.3.0 → 6.3.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: 4d6cedb1952a6df3b069bb85d94e169d4aeb7878e6e4dde0dcb3fe4a2915a747
4
- data.tar.gz: 2ad3bb2a4ef2575af9b976da0c59eb22b7e4d8b9e0a44e477329222feb567e09
3
+ metadata.gz: 7c2b1404b98062478370f77b91348c5480783bbf6353fcc4d1beea0603bea63f
4
+ data.tar.gz: 2134d1e2ce2af29a4b72f75a8c7b8bea073b215f2ace05be9e3cefd2f10e7587
5
5
  SHA512:
6
- metadata.gz: 90ea9ec5403ad5e0953582e4a8c17369a0722c3f79d6b5a9d25e1f756a2cc024d01824a7e469a10dd98a7289aef6b34496dc6987565885fa01b3e8d0d6fb8e8c
7
- data.tar.gz: aa7a667ef8de152cca8cd67df56d0f55a03ac7429f114d619bec1ac05178c015ba6c932f6fd651f27031c860927b81a3dc98bcd53ff7ef4080120a58404cd8f8
6
+ metadata.gz: 1b787d125aa066e36a2f905bd9e707253c77f75a8abe189ca6eb6f160fa4203960064089ec6ba15ea3e16d83826d6f2346528b95942681226fca32b47a09763a
7
+ data.tar.gz: 1396bb30353567e42df1ecd602b6c93c88034d9755be47a1848b70200ceb1111cf35fcad0abd8c5d44881563821ae3d555be222153141da6723b1648072895c3
@@ -1,41 +1,22 @@
1
- // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2
- // https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/ruby
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3
3
  {
4
4
  "name": "Ruby",
5
- "build": {
6
- "dockerfile": "Dockerfile",
7
- "args": {
8
- // Update 'VARIANT' to pick a Ruby version: 3, 3.1, 3.0, 2, 2.7
9
- // Append -bullseye or -buster to pin to an OS version.
10
- // Use -bullseye variants on local on arm64/Apple Silicon.
11
- "VARIANT": "3-bullseye",
12
- // Options
13
- "NODE_VERSION": "16"
14
- }
15
- },
5
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
+ "image": "mcr.microsoft.com/devcontainers/ruby:1-3.3-bullseye"
7
+
8
+ // Features to add to the dev container. More info: https://containers.dev/features.
9
+ // "features": {},
16
10
 
17
- // Configure tool-specific properties.
18
- "customizations": {
19
- // Configure properties specific to VS Code.
20
- "vscode": {
21
- // Add the IDs of extensions you want installed when the container is created.
22
- "extensions": [
23
- "rebornix.Ruby"
24
- ]
25
- }
26
- },
27
-
28
11
  // Use 'forwardPorts' to make a list of ports inside the container available locally.
29
12
  // "forwardPorts": [],
30
13
 
31
14
  // Use 'postCreateCommand' to run commands after the container is created.
32
15
  // "postCreateCommand": "ruby --version",
33
16
 
34
- // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
35
- "remoteUser": "vscode",
36
- "features": {
37
- "ghcr.io/devcontainers-contrib/features/act:1": {},
38
- "ghcr.io/devcontainers/features/docker-in-docker:2": {}
39
- }
17
+ // Configure tool-specific properties.
18
+ // "customizations": {},
40
19
 
20
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
21
+ // "remoteUser": "root"
41
22
  }
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
@@ -8,14 +8,14 @@ jobs:
8
8
  release:
9
9
  runs-on: ubuntu-latest
10
10
  steps:
11
- - uses: google-github-actions/release-please-action@v3
11
+ - uses: google-github-actions/release-please-action@v4
12
12
  id: release
13
13
  with:
14
14
  release-type: ruby
15
15
  package-name: rotp
16
16
  version-file: "lib/rotp/version.rb"
17
17
  # Checkout code if release was created
18
- - uses: actions/checkout@v2
18
+ - uses: actions/checkout@v4
19
19
  if: ${{ steps.release.outputs.release_created }}
20
20
  # Setup ruby if a release was created
21
21
  - uses: ruby/setup-ruby@v1
@@ -4,7 +4,7 @@ on:
4
4
  push:
5
5
  branches: [ main ]
6
6
  pull_request:
7
- types: [opened, reopened, synchronize]
7
+ branches: [ main ]
8
8
 
9
9
  jobs:
10
10
  test:
@@ -12,11 +12,11 @@ jobs:
12
12
  runs-on: ubuntu-latest
13
13
 
14
14
  strategy:
15
+ # Include '3.5.0-preview1' to test compatibility with the upcoming Ruby 3.5 release.
15
16
  matrix:
16
- ruby-version: ['3.2', '3.0', '2.7', '2.3', truffleruby-head]
17
-
17
+ ruby-version: ['3.5.0-preview1', '3.4', '3.3', '3.2', '3.0', '2.7', '2.3', 'truffleruby-head']
18
18
  steps:
19
- - uses: actions/checkout@v3
19
+ - uses: actions/checkout@v4
20
20
  - name: Set up Ruby ${{ matrix.ruby-version }}
21
21
  uses: ruby/setup-ruby@v1
22
22
  with:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [6.3.1] (2025-06-03)
4
+
5
+ * Fix: Drop usage of OpenStruct to support Ruby 3.5
6
+
3
7
  ## [6.3.0](https://github.com/mdp/rotp/compare/v6.2.2...v6.3.0) (2023-08-30)
4
8
 
5
9
 
@@ -1,8 +1,9 @@
1
1
  require 'optparse'
2
- require 'ostruct'
3
2
 
4
3
  module ROTP
5
4
  class Arguments
5
+ Options = Struct.new(:time, :counter, :mode, :digest, :secret, :warnings)
6
+
6
7
  def initialize(filename, arguments)
7
8
  @filename = filename
8
9
  @arguments = Array(arguments)
@@ -26,7 +27,15 @@ module ROTP
26
27
  end
27
28
 
28
29
  def default_options
29
- OpenStruct.new time: true, counter: 0, mode: :time
30
+ o = Options.new
31
+ o.time = true
32
+ o.counter = 0
33
+ o.mode = :time
34
+ o
35
+ end
36
+
37
+ def to_h
38
+ options!.to_h
30
39
  end
31
40
 
32
41
  def parse
data/lib/rotp/cli.rb CHANGED
@@ -31,9 +31,9 @@ module ROTP
31
31
  return arguments.to_s if options.mode == :help
32
32
 
33
33
  if options.mode == :time
34
- ROTP::TOTP.new(options.secret, options).now
34
+ ROTP::TOTP.new(options.secret, options.to_h).now
35
35
  elsif options.mode == :hmac
36
- ROTP::HOTP.new(options.secret, options).at options.counter
36
+ ROTP::HOTP.new(options.secret, options.to_h).at options.counter
37
37
  end
38
38
  end
39
39
 
data/lib/rotp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ROTP
2
- VERSION = '6.3.0'.freeze
2
+ VERSION = '6.3.1'.freeze
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'uri'
2
3
 
3
4
  RSpec.describe ROTP::HOTP do
4
5
  let(:counter) { 1234 }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rotp
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.0
4
+ version: 6.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Percival
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-30 00:00:00.000000000 Z
11
+ date: 2026-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -74,9 +74,9 @@ executables:
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
- - ".devcontainer/Dockerfile"
78
77
  - ".devcontainer/devcontainer.json"
79
78
  - ".dockerignore"
79
+ - ".github/dependabot.yml"
80
80
  - ".github/workflows/release.yaml"
81
81
  - ".github/workflows/test.yaml"
82
82
  - ".gitignore"
@@ -113,7 +113,7 @@ homepage: https://github.com/mdp/rotp
113
113
  licenses:
114
114
  - MIT
115
115
  metadata: {}
116
- post_install_message:
116
+ post_install_message:
117
117
  rdoc_options: []
118
118
  require_paths:
119
119
  - lib
@@ -128,8 +128,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  requirements: []
131
- rubygems_version: 3.4.10
132
- signing_key:
131
+ rubygems_version: 3.5.22
132
+ signing_key:
133
133
  specification_version: 4
134
134
  summary: A Ruby library for generating and verifying one time passwords
135
135
  test_files: []
@@ -1,19 +0,0 @@
1
- # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/ruby/.devcontainer/base.Dockerfile
2
-
3
- # [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.1, 3.0, 2, 2.7, 3-bullseye, 3.1-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 3-buster, 3.1-buster, 3.0-buster, 2-buster, 2.7-buster
4
- ARG VARIANT="3.1-bullseye"
5
- FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT}
6
-
7
- # [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
8
- ARG NODE_VERSION="none"
9
- RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
10
-
11
- # [Optional] Uncomment this section to install additional OS packages.
12
- # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
13
- # && apt-get -y install --no-install-recommends <your-package-list-here>
14
-
15
- # [Optional] Uncomment this line to install additional gems.
16
- # RUN gem install <your-gem-names-here>
17
-
18
- # [Optional] Uncomment this line to install global node packages.
19
- # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1