Sha256: 9dfbe56d4137503c7ec4fc749e825957d122879236cd6a7f0484708900a019d2

Contents?: true

Size: 447 Bytes

Versions: 8

Compression:

Stored size: 447 Bytes

Contents

# frozen_string_literal: true

module Vertebrae
  module Authorization
    def username?
      username.present?
    end

    def password?
      password.present?
    end

    # Check whether authentication credentials are present
    def authenticated?
      (username? && password?)
    end

    def basic_auth
      "#{username}:#{password}"
    end

    def authentication
      { :basic_auth => basic_auth }
    end
  end # Authorization
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vertebrae-0.8.0 lib/vertebrae/authorization.rb
vertebrae-1.0.5 lib/vertebrae/authorization.rb
vertebrae-1.0.4 lib/vertebrae/authorization.rb
vertebrae-1.0.2 lib/vertebrae/authorization.rb
vertebrae-1.0.1 lib/vertebrae/authorization.rb
vertebrae-1.0.0 lib/authorization.rb
vertebrae-0.7.0 lib/authorization.rb
vertebrae-0.6.2 lib/authorization.rb