File: none.rb

package info (click to toggle)
ruby-jwt 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 876 kB
  • sloc: ruby: 5,550; makefile: 4
file content (24 lines) | stat: -rw-r--r-- 341 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

module JWT
  module JWA
    # Implementation of the none algorithm
    class None
      include JWT::JWA::SigningAlgorithm

      def initialize
        @alg = 'none'
      end

      def sign(*)
        ''
      end

      def verify(*)
        true
      end

      register_algorithm(new)
    end
  end
end