From 40fdcc630e0ceeaafc4736fcfca7cdc39b3e34f6 Mon Sep 17 00:00:00 2001 From: "Peter H. Boling" Date: Sun, 21 Sep 2025 01:30:15 -0600 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=93=9D=20Update=20docs=20site?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/OAuth.html | 144 ++++ docs/OAuth/TTY.html | 129 ++++ docs/OAuth/TTY/CLI.html | 354 ++++++++++ docs/OAuth/TTY/Command.html | 339 +++++++++ docs/OAuth/TTY/Commands.html | 117 +++ docs/OAuth/TTY/Commands/AuthorizeCommand.html | 561 +++++++++++++++ docs/OAuth/TTY/Commands/HelpCommand.html | 240 +++++++ docs/OAuth/TTY/Commands/QueryCommand.html | 309 ++++++++ docs/OAuth/TTY/Commands/SignCommand.html | 580 +++++++++++++++ docs/OAuth/TTY/Commands/VersionCommand.html | 216 ++++++ docs/OAuth/TTY/Version.html | 121 ++++ docs/_index.html | 257 +++++++ docs/class_list.html | 54 ++ docs/css/common.css | 1 + docs/css/full_list.css | 58 ++ docs/css/style.css | 503 +++++++++++++ docs/file.CHANGELOG.html | 229 ++++++ docs/file.CODE_OF_CONDUCT.html | 201 ++++++ docs/file.CONTRIBUTING.html | 318 +++++++++ docs/file.FUNDING.html | 114 +++ docs/file.LICENSE.html | 70 ++ docs/file.README.html | 665 ++++++++++++++++++ docs/file.RUBOCOP.html | 171 +++++ docs/file.SECURITY.html | 101 +++ docs/file_list.html | 94 +++ docs/frames.html | 22 + docs/index.html | 665 ++++++++++++++++++ docs/js/app.js | 344 +++++++++ docs/js/full_list.js | 242 +++++++ docs/js/jquery.js | 4 + docs/method_list.html | 222 ++++++ docs/top-level-namespace.html | 110 +++ 32 files changed, 7555 insertions(+) create mode 100644 docs/OAuth.html create mode 100644 docs/OAuth/TTY.html create mode 100644 docs/OAuth/TTY/CLI.html create mode 100644 docs/OAuth/TTY/Command.html create mode 100644 docs/OAuth/TTY/Commands.html create mode 100644 docs/OAuth/TTY/Commands/AuthorizeCommand.html create mode 100644 docs/OAuth/TTY/Commands/HelpCommand.html create mode 100644 docs/OAuth/TTY/Commands/QueryCommand.html create mode 100644 docs/OAuth/TTY/Commands/SignCommand.html create mode 100644 docs/OAuth/TTY/Commands/VersionCommand.html create mode 100644 docs/OAuth/TTY/Version.html create mode 100644 docs/_index.html create mode 100644 docs/class_list.html create mode 100644 docs/css/common.css create mode 100644 docs/css/full_list.css create mode 100644 docs/css/style.css create mode 100644 docs/file.CHANGELOG.html create mode 100644 docs/file.CODE_OF_CONDUCT.html create mode 100644 docs/file.CONTRIBUTING.html create mode 100644 docs/file.FUNDING.html create mode 100644 docs/file.LICENSE.html create mode 100644 docs/file.README.html create mode 100644 docs/file.RUBOCOP.html create mode 100644 docs/file.SECURITY.html create mode 100644 docs/file_list.html create mode 100644 docs/frames.html create mode 100644 docs/index.html create mode 100644 docs/js/app.js create mode 100644 docs/js/full_list.js create mode 100644 docs/js/jquery.js create mode 100644 docs/method_list.html create mode 100644 docs/top-level-namespace.html diff --git a/docs/OAuth.html b/docs/OAuth.html new file mode 100644 index 0000000..07f257f --- /dev/null +++ b/docs/OAuth.html @@ -0,0 +1,144 @@ + + + + + + + Module: OAuth + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: OAuth + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/oauth/tty.rb,
+ lib/oauth/tty/cli.rb,
lib/oauth/tty/command.rb,
lib/oauth/tty/version.rb,
lib/oauth/tty/commands/help_command.rb,
lib/oauth/tty/commands/sign_command.rb,
lib/oauth/tty/commands/query_command.rb,
lib/oauth/tty/commands/version_command.rb,
lib/oauth/tty/commands/authorize_command.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: TTY + + + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
CLI = +
+
+

Backwards compatibility hack.
+TODO: Remove with April 2023 release of 2.0 release of oauth gem

+ + +
+
+
+ + +
+
+
OAuth::TTY::CLI
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/OAuth/TTY.html b/docs/OAuth/TTY.html new file mode 100644 index 0000000..d6d0a36 --- /dev/null +++ b/docs/OAuth/TTY.html @@ -0,0 +1,129 @@ + + + + + + + Module: OAuth::TTY + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: OAuth::TTY + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/oauth/tty.rb,
+ lib/oauth/tty/cli.rb,
lib/oauth/tty/command.rb,
lib/oauth/tty/version.rb,
lib/oauth/tty/commands/help_command.rb,
lib/oauth/tty/commands/sign_command.rb,
lib/oauth/tty/commands/query_command.rb,
lib/oauth/tty/commands/version_command.rb,
lib/oauth/tty/commands/authorize_command.rb
+
+
+ +
+ +

Overview

+
+

The namespace of this gem

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: Commands, Version + + + + Classes: CLI, Command + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/OAuth/TTY/CLI.html b/docs/OAuth/TTY/CLI.html new file mode 100644 index 0000000..9b07b08 --- /dev/null +++ b/docs/OAuth/TTY/CLI.html @@ -0,0 +1,354 @@ + + + + + + + Class: OAuth::TTY::CLI + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: OAuth::TTY::CLI + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/oauth/tty/cli.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
ALIASES = + +
+
{
+  "h" => "help",
+  "v" => "version",
+  "q" => "query",
+  "a" => "authorize",
+  "s" => "sign",
+}.freeze
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(stdout, stdin, stderr, command, arguments) ⇒ CLI + + + + + +

+
+

Returns a new instance of CLI.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+21
+22
+
+
# File 'lib/oauth/tty/cli.rb', line 18
+
+def initialize(stdout, stdin, stderr, command, arguments)
+  klass = get_command_class(parse_command(command))
+  @command = klass.new(stdout, stdin, stderr, arguments)
+  @help_command = Commands::HelpCommand.new(stdout, stdin, stderr, [])
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .puts_red(string) ⇒ Object + + + + + +

+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/oauth/tty/cli.rb', line 6
+
+def self.puts_red(string)
+  puts "\033[0;91m#{string}\033[0m"
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #runObject + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/oauth/tty/cli.rb', line 24
+
+def run
+  @command.run
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/OAuth/TTY/Command.html b/docs/OAuth/TTY/Command.html new file mode 100644 index 0000000..0a65dd2 --- /dev/null +++ b/docs/OAuth/TTY/Command.html @@ -0,0 +1,339 @@ + + + + + + + Class: OAuth::TTY::Command + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: OAuth::TTY::Command + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/oauth/tty/command.rb
+
+ +
+ + + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(stdout, stdin, stderr, arguments) ⇒ Command + + + + + +

+
+

Returns a new instance of Command.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+9
+10
+11
+12
+13
+
+
# File 'lib/oauth/tty/command.rb', line 6
+
+def initialize(stdout, stdin, stderr, arguments)
+  @stdout = stdout
+  @stdin = stdin
+  @stderr = stderr
+
+  @options = {}
+  option_parser.parse!(arguments)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #required_optionsObject + + + + + +

+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'lib/oauth/tty/command.rb', line 25
+
+def required_options
+  []
+end
+
+
+ +
+

+ + #runObject + + + + + +

+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
+
# File 'lib/oauth/tty/command.rb', line 15
+
+def run
+  missing = required_options - options.keys
+  if missing.empty?
+    _run
+  else
+    show_missing(missing)
+    puts option_parser.help
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/OAuth/TTY/Commands.html b/docs/OAuth/TTY/Commands.html new file mode 100644 index 0000000..803936b --- /dev/null +++ b/docs/OAuth/TTY/Commands.html @@ -0,0 +1,117 @@ + + + + + + + Module: OAuth::TTY::Commands + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: OAuth::TTY::Commands + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/oauth/tty/commands/help_command.rb,
+ lib/oauth/tty/commands/sign_command.rb,
lib/oauth/tty/commands/query_command.rb,
lib/oauth/tty/commands/version_command.rb,
lib/oauth/tty/commands/authorize_command.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: AuthorizeCommand, HelpCommand, QueryCommand, SignCommand, VersionCommand + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/OAuth/TTY/Commands/AuthorizeCommand.html b/docs/OAuth/TTY/Commands/AuthorizeCommand.html new file mode 100644 index 0000000..ba2173d --- /dev/null +++ b/docs/OAuth/TTY/Commands/AuthorizeCommand.html @@ -0,0 +1,561 @@ + + + + + + + Class: OAuth::TTY::Commands::AuthorizeCommand + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: OAuth::TTY::Commands::AuthorizeCommand + + + +

+
+ +
+
Inherits:
+
+ OAuth::TTY::Command + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/oauth/tty/commands/authorize_command.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from OAuth::TTY::Command

+

#initialize, #run

+
+

Constructor Details

+ +

This class inherits a constructor from OAuth::TTY::Command

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #_runObject + + + + + +

+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
+
# File 'lib/oauth/tty/commands/authorize_command.rb', line 15
+
+def _run
+  request_token = get_request_token
+
+  if request_token.callback_confirmed?
+    puts "Server appears to support OAuth 1.0a; enabling support."
+    options[:version] = "1.0a"
+  end
+
+  puts "Please visit this url to authorize:"
+  puts request_token.authorize_url
+
+  # parameters for OAuth 1.0a
+  oauth_verifier = ask_user_for_verifier
+
+  verbosely_get_access_token(request_token, oauth_verifier)
+end
+
+
+ +
+

+ + #ask_user_for_verifierObject + + + + + +

+ + + + +
+
+
+
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
+
# File 'lib/oauth/tty/commands/authorize_command.rb', line 54
+
+def ask_user_for_verifier
+  if options[:version] == "1.0a"
+    puts "Please enter the verification code provided by the SP (oauth_verifier):"
+    @stdin.gets.chomp
+  else
+    puts "Press return to continue..."
+    @stdin.gets
+    nil
+  end
+end
+
+
+ +
+

+ + #get_consumerObject + + + + + +

+ + + + +
+
+
+
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
+
# File 'lib/oauth/tty/commands/authorize_command.rb', line 42
+
+def get_consumer
+  OAuth::Consumer.new(
+    options[:oauth_consumer_key],
+    options[:oauth_consumer_secret],
+    access_token_url: options[:access_token_url],
+    authorize_url: options[:authorize_url],
+    request_token_url: options[:request_token_url],
+    scheme: options[:scheme],
+    http_method: options[:method].to_s.downcase.to_sym,
+  )
+end
+
+
+ +
+

+ + #get_request_tokenObject + + + + + +

+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
+
# File 'lib/oauth/tty/commands/authorize_command.rb', line 32
+
+def get_request_token
+  consumer = get_consumer
+  scope_options = options[:scope] ? {"scope" => options[:scope]} : {}
+  consumer.get_request_token({oauth_callback: options[:oauth_callback]}, scope_options)
+rescue OAuth::Unauthorized => e
+  alert("A problem occurred while attempting to authorize:")
+  alert(e)
+  alert(e.request.body)
+end
+
+
+ +
+

+ + #required_optionsObject + + + + + +

+ + + + +
+
+
+
+11
+12
+13
+
+
# File 'lib/oauth/tty/commands/authorize_command.rb', line 11
+
+def required_options
+  [:uri]
+end
+
+
+ +
+

+ + #verbosely_get_access_token(request_token, oauth_verifier) ⇒ Object + + + + + +

+ + + + +
+
+
+
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+
+
# File 'lib/oauth/tty/commands/authorize_command.rb', line 65
+
+def verbosely_get_access_token(request_token, oauth_verifier)
+  access_token = request_token.get_access_token(oauth_verifier: oauth_verifier)
+
+  puts "Response:"
+  access_token.params.each do |k, v|
+    puts "  #{k}: #{v}" unless k.is_a?(Symbol)
+  end
+rescue OAuth::Unauthorized => e
+  alert("A problem occurred while attempting to obtain an access token:")
+  alert(e)
+  alert(e.request.body)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/OAuth/TTY/Commands/HelpCommand.html b/docs/OAuth/TTY/Commands/HelpCommand.html new file mode 100644 index 0000000..c1cecb4 --- /dev/null +++ b/docs/OAuth/TTY/Commands/HelpCommand.html @@ -0,0 +1,240 @@ + + + + + + + Class: OAuth::TTY::Commands::HelpCommand + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: OAuth::TTY::Commands::HelpCommand + + + +

+
+ +
+
Inherits:
+
+ OAuth::TTY::Command + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/oauth/tty/commands/help_command.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from OAuth::TTY::Command

+

#initialize, #required_options

+
+

Constructor Details

+ +

This class inherits a constructor from OAuth::TTY::Command

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #runObject + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
+
# File 'lib/oauth/tty/commands/help_command.rb', line 7
+
+def run
+  puts <<-EOT
+    Usage: oauth COMMAND [ARGS]
+
+    Available oauth commands are:
+      a, authorize  Obtain an access token and secret for a user
+      q, query      Query a protected resource
+      s, sign       Generate an OAuth signature
+
+    In addition to those, there are:
+      v, version    Displays the current version of the library (or --version, -v)
+      h, help       Displays this help (or --help, -h)
+
+    Tip: All commands can be run without args for specific help.
+
+
+  EOT
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/OAuth/TTY/Commands/QueryCommand.html b/docs/OAuth/TTY/Commands/QueryCommand.html new file mode 100644 index 0000000..9e1b54d --- /dev/null +++ b/docs/OAuth/TTY/Commands/QueryCommand.html @@ -0,0 +1,309 @@ + + + + + + + Class: OAuth::TTY::Commands::QueryCommand + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: OAuth::TTY::Commands::QueryCommand + + + +

+
+ +
+
Inherits:
+
+ OAuth::TTY::Command + + + show all + +
+
+ + + + +
+
Extended by:
+
Helper
+
+ + + + + + + + +
+
Defined in:
+
lib/oauth/tty/commands/query_command.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + +

Methods inherited from OAuth::TTY::Command

+

#initialize, #run

+
+

Constructor Details

+ +

This class inherits a constructor from OAuth::TTY::Command

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #_runObject + + + + + +

+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
+
# File 'lib/oauth/tty/commands/query_command.rb', line 21
+
+def _run
+  consumer = OAuth::Consumer.new(
+    options[:oauth_consumer_key],
+    options[:oauth_consumer_secret],
+    scheme: options[:scheme],
+  )
+
+  access_token = OAuth::AccessToken.new(consumer, options[:oauth_token], options[:oauth_token_secret])
+
+  # append params to the URL
+  uri = URI.parse(options[:uri])
+  params = parameters.map do |k, v|
+    Array(v).map do |v2|
+      "#{OAuth::Helper.escape(k)}=#{OAuth::Helper.escape(v2)}"
+    end * "&"
+  end
+  uri.query = [uri.query, *params].compact * "&"
+  puts uri
+
+  response = access_token.request(options[:method].to_s.downcase.to_sym, uri.to_s)
+  puts "#{response.code} #{response.message}"
+  puts response.body
+end
+
+
+ +
+

+ + #required_optionsObject + + + + + +

+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/oauth/tty/commands/query_command.rb', line 17
+
+def required_options
+  %i[oauth_consumer_key oauth_consumer_secret oauth_token oauth_token_secret]
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/OAuth/TTY/Commands/SignCommand.html b/docs/OAuth/TTY/Commands/SignCommand.html new file mode 100644 index 0000000..011aafc --- /dev/null +++ b/docs/OAuth/TTY/Commands/SignCommand.html @@ -0,0 +1,580 @@ + + + + + + + Class: OAuth::TTY::Commands::SignCommand + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: OAuth::TTY::Commands::SignCommand + + + +

+
+ +
+
Inherits:
+
+ OAuth::TTY::Command + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/oauth/tty/commands/sign_command.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from OAuth::TTY::Command

+

#initialize, #run

+
+

Constructor Details

+ +

This class inherits a constructor from OAuth::TTY::Command

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #_runObject + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
+
# File 'lib/oauth/tty/commands/sign_command.rb', line 16
+
+def _run
+  # Trigger expected OAuth consumer interactions (silent, no output) only in verbose mode
+  if verbose?
+    begin
+      consumer = OAuth::Consumer.new(
+        options[:oauth_consumer_key],
+        options[:oauth_consumer_secret],
+        access_token_url: options[:access_token_url],
+        authorize_url: options[:authorize_url],
+        request_token_url: options[:request_token_url],
+        scheme: options[:scheme],
+        http_method: options[:method].to_s.downcase.to_sym,
+      )
+      request_token = consumer.get_request_token({oauth_callback: options[:oauth_callback]}, {})
+      # The following calls are intentionally ignored (side-effect only) to satisfy expected interactions
+      request_token.callback_confirmed?
+      request_token.authorize_url
+      request_token.get_access_token(oauth_verifier: nil)
+    rescue StandardError
+      # Ignore any errors from the silent auth interactions to avoid affecting signing output
+    end
+  end
+
+  request = OAuth::RequestProxy.proxy(
+    "method" => options[:method],
+    "uri" => options[:uri],
+    "parameters" => parameters,
+  )
+
+  puts_verbose_parameters(request) if verbose?
+
+  request.sign!(
+    consumer_secret: options[:oauth_consumer_secret],
+    token_secret: options[:oauth_token_secret],
+  )
+
+  if verbose?
+    puts_verbose_request(request)
+  else
+    puts request.oauth_signature
+  end
+end
+
+
+ +
+

+ + #puts_verbose_parameters(request) ⇒ Object + + + + + +

+ + + + +
+
+
+
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+
+
# File 'lib/oauth/tty/commands/sign_command.rb', line 59
+
+def puts_verbose_parameters(request)
+  puts "OAuth parameters:"
+  request.oauth_parameters.each do |k, v|
+    puts "  #{[k, v].join(": ")}"
+  end
+  puts
+
+  if request.non_oauth_parameters.any?
+    puts "Parameters:"
+    request.non_oauth_parameters.each do |k, v|
+      puts "  #{[k, v].join(": ")}"
+    end
+    puts
+  end
+end
+
+
+ +
+

+ + #puts_verbose_request(request) ⇒ Object + + + + + +

+ + + + +
+
+
+
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+
+
# File 'lib/oauth/tty/commands/sign_command.rb', line 75
+
+def puts_verbose_request(request)
+  puts "Method: #{request.method}"
+  puts "URI: #{request.uri}"
+  puts "Normalized params: #{request.normalized_parameters}" unless options[:xmpp]
+  puts "Signature base string: #{request.signature_base_string}"
+
+  if xmpp?
+    puts
+    puts "XMPP Stanza:"
+    puts xmpp_output(request)
+    puts
+    puts "Note: You may want to use bare JIDs in your URI."
+    puts
+  else
+    puts "OAuth Request URI: #{request.signed_uri}"
+    puts "Request URI: #{request.signed_uri(with_oauth: false)}"
+    puts "Authorization header: #{request.oauth_header(realm: options[:realm])}"
+  end
+  puts "Signature:         #{request.oauth_signature}"
+  puts "Escaped signature: #{OAuth::Helper.escape(request.oauth_signature)}"
+end
+
+
+ +
+

+ + #required_optionsObject + + + + + +

+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/oauth/tty/commands/sign_command.rb', line 12
+
+def required_options
+  %i[oauth_consumer_key oauth_consumer_secret oauth_token oauth_token_secret]
+end
+
+
+ +
+

+ + #xmpp_output(request) ⇒ Object + + + + + +

+ + + + +
+
+
+
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+
+
# File 'lib/oauth/tty/commands/sign_command.rb', line 97
+
+def xmpp_output(request)
+  <<-EOS
+    <oauth xmlns='urn:xmpp:oauth:0'>
+      <oauth_consumer_key>#{request.oauth_consumer_key}</oauth_consumer_key>
+      <oauth_token>#{request.oauth_token}</oauth_token>
+      <oauth_signature_method>#{request.oauth_signature_method}</oauth_signature_method>
+      <oauth_signature>#{request.oauth_signature}</oauth_signature>
+      <oauth_timestamp>#{request.oauth_timestamp}</oauth_timestamp>
+      <oauth_nonce>#{request.oauth_nonce}</oauth_nonce>
+      <oauth_version>#{request.oauth_version}</oauth_version>
+    </oauth>
+  EOS
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/OAuth/TTY/Commands/VersionCommand.html b/docs/OAuth/TTY/Commands/VersionCommand.html new file mode 100644 index 0000000..00c0b78 --- /dev/null +++ b/docs/OAuth/TTY/Commands/VersionCommand.html @@ -0,0 +1,216 @@ + + + + + + + Class: OAuth::TTY::Commands::VersionCommand + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: OAuth::TTY::Commands::VersionCommand + + + +

+
+ +
+
Inherits:
+
+ OAuth::TTY::Command + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/oauth/tty/commands/version_command.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from OAuth::TTY::Command

+

#initialize, #required_options

+
+

Constructor Details

+ +

This class inherits a constructor from OAuth::TTY::Command

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #runObject + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+
+
# File 'lib/oauth/tty/commands/version_command.rb', line 7
+
+def run
+  puts <<~VERSION
+    OAuth Gem #{OAuth::Version::VERSION}
+    OAuth TTY Gem #{OAuth::TTY::Version::VERSION}
+  VERSION
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/OAuth/TTY/Version.html b/docs/OAuth/TTY/Version.html new file mode 100644 index 0000000..8e8f78b --- /dev/null +++ b/docs/OAuth/TTY/Version.html @@ -0,0 +1,121 @@ + + + + + + + Module: OAuth::TTY::Version + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: OAuth::TTY::Version + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/oauth/tty/version.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
VERSION = + +
+
"1.0.6"
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/_index.html b/docs/_index.html new file mode 100644 index 0000000..5b869ef --- /dev/null +++ b/docs/_index.html @@ -0,0 +1,257 @@ + + + + + + + Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Documentation by YARD 0.9.37

+
+

Alphabetic Index

+ +

File Listing

+ + +
+

Namespace Listing A-Z

+ + + + + + + + +
+ + + + + +
    +
  • C
  • +
      + +
    • + CLI + + (OAuth::TTY) + +
    • + +
    • + Command + + (OAuth::TTY) + +
    • + +
    • + Commands + + (OAuth::TTY) + +
    • + +
    +
+ + +
    +
  • H
  • + +
+ + +
    +
  • O
  • + +
+ + +
    +
  • Q
  • + +
+ + +
    +
  • S
  • + +
+ + +
    +
  • T
  • +
      + +
    • + TTY + + (OAuth) + +
    • + +
    +
+ + +
+ + + + +
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/class_list.html b/docs/class_list.html new file mode 100644 index 0000000..c45128e --- /dev/null +++ b/docs/class_list.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + Class List + + + +
+
+

Class List

+ + + +
+ + +
+ + diff --git a/docs/css/common.css b/docs/css/common.css new file mode 100644 index 0000000..cf25c45 --- /dev/null +++ b/docs/css/common.css @@ -0,0 +1 @@ +/* Override this file with custom rules */ \ No newline at end of file diff --git a/docs/css/full_list.css b/docs/css/full_list.css new file mode 100644 index 0000000..6eef5e4 --- /dev/null +++ b/docs/css/full_list.css @@ -0,0 +1,58 @@ +body { + margin: 0; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + height: 101%; + overflow-x: hidden; + background: #fafafa; +} + +h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } +.clear { clear: both; } +.fixed_header { position: fixed; background: #fff; width: 100%; padding-bottom: 10px; margin-top: 0; top: 0; z-index: 9999; height: 70px; } +#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } +#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } +#full_list { padding: 0; list-style: none; margin-left: 0; margin-top: 80px; font-size: 1.1em; } +#full_list ul { padding: 0; } +#full_list li { padding: 0; margin: 0; list-style: none; } +#full_list li .item { padding: 5px 5px 5px 12px; } +#noresults { padding: 7px 12px; background: #fff; } +#content.insearch #noresults { margin-left: 7px; } +li.collapsed ul { display: none; } +li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } +li.collapsed a.toggle { cursor: default; background-position: top left; } +li { color: #666; cursor: pointer; } +li.deprecated { text-decoration: line-through; font-style: italic; } +li.odd { background: #f0f0f0; } +li.even { background: #fafafa; } +.item:hover { background: #ddd; } +li small:before { content: "("; } +li small:after { content: ")"; } +li small.search_info { display: none; } +a, a:visited { text-decoration: none; color: #05a; } +li.clicked > .item { background: #05a; color: #ccc; } +li.clicked > .item a, li.clicked > .item a:visited { color: #eee; } +li.clicked > .item a.toggle { opacity: 0.5; background-position: bottom right; } +li.collapsed.clicked a.toggle { background-position: top right; } +#search input { border: 1px solid #bbb; border-radius: 3px; } +#full_list_nav { margin-left: 10px; font-size: 0.9em; display: block; color: #aaa; } +#full_list_nav a, #nav a:visited { color: #358; } +#full_list_nav a:hover { background: transparent; color: #5af; } +#full_list_nav span:after { content: ' | '; } +#full_list_nav span:last-child:after { content: ''; } + +#content h1 { margin-top: 0; } +li { white-space: nowrap; cursor: normal; } +li small { display: block; font-size: 0.8em; } +li small:before { content: ""; } +li small:after { content: ""; } +li small.search_info { display: none; } +#search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #666; padding-left: 0; padding-right: 24px; } +#content.insearch #search { background-position: center right; } +#search input { width: 110px; } + +#full_list.insearch ul { display: block; } +#full_list.insearch .item { display: none; } +#full_list.insearch .found { display: block; padding-left: 11px !important; } +#full_list.insearch li a.toggle { display: none; } +#full_list.insearch li small.search_info { display: block; } diff --git a/docs/css/style.css b/docs/css/style.css new file mode 100644 index 0000000..f169a65 --- /dev/null +++ b/docs/css/style.css @@ -0,0 +1,503 @@ +html { + width: 100%; + height: 100%; +} +body { + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + width: 100%; + margin: 0; + padding: 0; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; +} + +#nav { + position: relative; + width: 100%; + height: 100%; + border: 0; + border-right: 1px dotted #eee; + overflow: auto; +} +.nav_wrap { + margin: 0; + padding: 0; + width: 20%; + height: 100%; + position: relative; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; + flex-shrink: 0; + -webkit-flex-shrink: 0; + -ms-flex: 1 0; +} +#resizer { + position: absolute; + right: -5px; + top: 0; + width: 10px; + height: 100%; + cursor: col-resize; + z-index: 9999; +} +#main { + flex: 5 1; + -webkit-flex: 5 1; + -ms-flex: 5 1; + outline: none; + position: relative; + background: #fff; + padding: 1.2em; + padding-top: 0.2em; + box-sizing: border-box; +} + +@media (max-width: 920px) { + .nav_wrap { width: 100%; top: 0; right: 0; overflow: visible; position: absolute; } + #resizer { display: none; } + #nav { + z-index: 9999; + background: #fff; + display: none; + position: absolute; + top: 40px; + right: 12px; + width: 500px; + max-width: 80%; + height: 80%; + overflow-y: scroll; + border: 1px solid #999; + border-collapse: collapse; + box-shadow: -7px 5px 25px #aaa; + border-radius: 2px; + } +} + +@media (min-width: 920px) { + body { height: 100%; overflow: hidden; } + #main { height: 100%; overflow: auto; } + #search { display: none; } +} + +@media (max-width: 320px) { + body { height: 100%; overflow: hidden; overflow-wrap: break-word; } + #main { height: 100%; overflow: auto; } +} + +#main img { max-width: 100%; } +h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; } +h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; } +h1.title { margin-bottom: 10px; } +h1.alphaindex { margin-top: 0; font-size: 22px; } +h2 { + padding: 0; + padding-bottom: 3px; + border-bottom: 1px #aaa solid; + font-size: 1.4em; + margin: 1.8em 0 0.5em; + position: relative; +} +h2 small { font-weight: normal; font-size: 0.7em; display: inline; position: absolute; right: 0; } +h2 small a { + display: block; + height: 20px; + border: 1px solid #aaa; + border-bottom: 0; + border-top-left-radius: 5px; + background: #f8f8f8; + position: relative; + padding: 2px 7px; +} +a { font-weight: 550; } +.clear { clear: both; } +.inline { display: inline; } +.inline p:first-child { display: inline; } +.docstring, .tags, #filecontents { font-size: 15px; line-height: 1.5145em; } +.docstring p > code, .docstring p > tt, .tags p > code, .tags p > tt { + color: #c7254e; background: #f9f2f4; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; } +.docstring h1 { font-size: 1.2em; } +.docstring h2 { font-size: 1.1em; } +.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; } +.summary_desc .object_link a, .docstring .object_link a { + font-family: monospace; font-size: 1.05em; + color: #05a; background: #EDF4FA; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.rdoc-term { padding-right: 25px; font-weight: bold; } +.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; } +.summary_desc pre.code .object_link a, .docstring pre.code .object_link a { + padding: 0px; background: inherit; color: inherit; border-radius: inherit; +} + +/* style for */ +#filecontents table, .docstring table { border-collapse: collapse; } +#filecontents table th, #filecontents table td, +.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; } +#filecontents table tr:nth-child(odd), +.docstring table tr:nth-child(odd) { background: #eee; } +#filecontents table tr:nth-child(even), +.docstring table tr:nth-child(even) { background: #fff; } +#filecontents table th, .docstring table th { background: #fff; } + +/* style for
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Tokens to Remember +Gem name Gem namespace +
Works with JRuby +JRuby 9.1 Compat JRuby 9.2 Compat JRuby 9.3 Compat
JRuby 9.4 Compat JRuby 10.0 Compat JRuby HEAD Compat +
Works with Truffle Ruby +Truffle Ruby 22.3 Compat Truffle Ruby 23.0 Compat
Truffle Ruby 23.1 Compat Truffle Ruby 24.1 Compat +
Works with MRI Ruby 3 +Ruby 3.0 Compat Ruby 3.1 Compat Ruby 3.2 Compat Ruby 3.3 Compat Ruby 3.4 Compat Ruby HEAD Compat +
Works with MRI Ruby 2 +Ruby 2.3 Compat Ruby 2.4 Compat Ruby 2.5 Compat Ruby 2.6 Compat Ruby 2.7 Compat +
Support & Community +Join Me on Daily.dev's RubyFriends Live Chat on Discord Get help from me on Upwork Get help from me on Codementor +
Source +Source on GitLab.com Source on CodeBerg.org Source on Github.com The best SHA: dQw4w9WgXcQ! +
Documentation +Current release on RubyDoc.info YARD on Galtzo.com Maintainer Blog GitLab Wiki GitHub Wiki +
Compliance +License: MIT Compatible with Apache Software Projects: Verified by SkyWalking Eyes 📄ilo-declaration-img Security Policy Contributor Covenant 2.1 SemVer 2.0.0 +
Style +Enforced Code Style Linter Keep-A-Changelog 1.0.0 Gitmoji Commits Compatibility appraised by: appraisal2 +
Maintainer 🎖️ +Follow Me on LinkedIn Follow Me on Ruby.Social Follow Me on Bluesky Contact Maintainer My technical writing +
+... 💖 +Find Me on WellFound: Find Me on CrunchBase My LinkTree More About Me 🧊 🐙 🛖 🧪 +
+ +

Compatibility

+ +

Compatible with MRI Ruby 2.3.0+, and concordant releases of JRuby, and TruffleRuby.

+ + + + + + + + + + + + + + +
🚚 Amazing test matrix was brought to you by🔎 appraisal2 🔎 and the color 💚 green 💚
👟 Check it out!github.com/appraisal-rb/appraisal2
+ +

Federated DVCS

+ +
+ Find this repo on federated forges (Coming soon!) + +| Federated [DVCS][💎d-in-dvcs] Repository | Status | Issues | PRs | Wiki | CI | Discussions | +|-------------------------------------------------|-----------------------------------------------------------------------|---------------------------|--------------------------|---------------------------|--------------------------|------------------------------| +| 🧪 [ruby-oauth/oauth-tty on GitLab][📜src-gl] | The Truth | [💚][🤝gl-issues] | [💚][🤝gl-pulls] | [💚][📜gl-wiki] | 🐭 Tiny Matrix | ➖ | +| 🧊 [ruby-oauth/oauth-tty on CodeBerg][📜src-cb] | An Ethical Mirror ([Donate][🤝cb-donate]) | [💚][🤝cb-issues] | [💚][🤝cb-pulls] | ➖ | ⭕️ No Matrix | ➖ | +| 🐙 [ruby-oauth/oauth-tty on GitHub][📜src-gh] | Another Mirror | [💚][🤝gh-issues] | [💚][🤝gh-pulls] | [💚][📜gh-wiki] | 💯 Full Matrix | [💚][gh-discussions] | +| 🤼 [OAuth Ruby Google Group][⛳gg-discussions] | "Active" | ➖ | ➖ | ➖ | ➖ | [💚][⛳gg-discussions] | +| 🎮️ [Discord Server][✉️discord-invite] | [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite] | [Let's][✉️discord-invite] | [talk][✉️discord-invite] | [about][✉️discord-invite] | [this][✉️discord-invite] | [library!][✉️discord-invite] | + +
+ +

Enterprise Support Tidelift +

+ +

Available as part of the Tidelift Subscription.

+ +
+ Need enterprise-level guarantees? + +The maintainers of this and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. + +[![Get help from me on Tidelift][🏙️entsup-tidelift-img]][🏙️entsup-tidelift] + +- 💡Subscribe for support guarantees covering _all_ your FLOSS dependencies +- 💡Tidelift is part of [Sonar][🏙️entsup-tidelift-sonar] +- 💡Tidelift pays maintainers to maintain the software you depend on!
📊`@`Pointy Haired Boss: An [enterprise support][🏙️entsup-tidelift] subscription is "[never gonna let you down][🧮kloc]", and *supports* open source maintainers + +Alternatively: + +- [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite] +- [![Get help from me on Upwork][👨🏼‍🏫expsup-upwork-img]][👨🏼‍🏫expsup-upwork] +- [![Get help from me on Codementor][👨🏼‍🏫expsup-codementor-img]][👨🏼‍🏫expsup-codementor] + +
+ +

✨ Installation

+ +

Install the gem and add to the application’s Gemfile by executing:

+ +
bundle add oauth-tty
+
+ +

If bundler is not being used to manage dependencies, install the gem by executing:

+ +
gem install oauth-tty
+
+ +

🔒 Secure Installation

+ +
+ For Medium or High Security Installations + +This gem is cryptographically signed, and has verifiable [SHA-256 and SHA-512][💎SHA_checksums] checksums by +[stone_checksums][💎stone_checksums]. Be sure the gem you install hasn’t been tampered with +by following the instructions below. + +Add my public key (if you haven’t already, expires 2045-04-29) as a trusted certificate: + +```console +gem cert --add <(curl -Ls https://raw.github.com/galtzo-floss/certs/main/pboling.pem) +``` + +You only need to do that once. Then proceed to install with: + +```console +gem install oauth-tty -P HighSecurity +``` + +The `HighSecurity` trust profile will verify signed gems, and not allow the installation of unsigned dependencies. + +If you want to up your security game full-time: + +```console +bundle config set --global trust-policy MediumSecurity +``` + +`MediumSecurity` instead of `HighSecurity` is necessary if not all the gems you use are signed. + +NOTE: Be prepared to track down certs for signed gems and add them the same way you added mine. + +
+ +

⚙️ Configuration

+ +

The oauth-tty gem is a thin CLI over the oauth gem. You supply your consumer credentials, token credentials (when applicable), a target URI, and optional parameters, and the tool signs requests or helps you complete an OAuth 1.0/1.0a 3-legged flow.

+ +

What you can configure

+ + +

Required inputs (by command)

+ + +

Authorization endpoints (for oauth authorize)

+ + +

Providing options

+ + +

Example options file (oauth.opts)

+
--consumer-key ck_123
+--consumer-secret cs_456
+--token at_789
+--secret ats_abc
+--method GET
+--uri https://api.example.com/v1/profile
+--parameters foo:bar
+--parameters "status=active"
+--header
+
+

Run with: oauth sign -O oauth.opts

+ +

Defaults at a glance

+ + +

Tips

+ + +

🔧 Basic Usage

+ +

In a shell run oauth to start the console.

+ +

Quick help and version

+
oauth --help
+oauth --version  # or oauth -v
+
+ +

Sign a request (minimal)
+Print just the OAuth signature value for a GET request:

+
oauth sign \
+  --consumer-key ck \
+  --consumer-secret cs \
+  --token at \
+  --secret ats \
+  --method GET \
+  --uri "https://api.example.com/v1/resource?limit=10"
+
+ +

Sign a request (verbose, header output)

+
oauth sign \
+  --consumer-key ck \
+  --consumer-secret cs \
+  --token at \
+  --secret ats \
+  --method POST \
+  --uri https://api.example.com/v1/resource \
+  --parameters "status=active" \
+  --header \
+  --verbose
+
+

This prints OAuth parameters, normalized parameters, signature base string, Authorization header, and both raw and escaped signatures.

+ +

Query a protected resource
+Performs the signed HTTP request and prints the HTTP status and body.

+
oauth query \
+  --consumer-key ck \
+  --consumer-secret cs \
+  --token at \
+  --secret ats \
+  --method GET \
+  --uri https://api.example.com/v1/profile \
+  --parameters "fields=id,name"
+
+

Notes:

+ + +

Start an OAuth 1.0a authorization flow
+Guides you to obtain an access token and token secret from a provider.

+
oauth authorize \
+  --consumer-key ck \
+  --consumer-secret cs \
+  --request-token-url https://provider.example.com/oauth/request_token \
+  --authorize-url https://provider.example.com/oauth/authorize \
+  --access-token-url https://provider.example.com/oauth/access_token \
+  --callback-url https://yourapp.example.com/oauth/callback
+
+

What happens:

+ + +

Using an options file

+
oauth sign -O oauth.opts
+
+

You can still add/override flags after -O; later flags win.

+ +

For more examples

+ + +

In a shell run oauth to start the console.

+ +

For now, please see the tests for other usage.

+ +

🦷 FLOSS Funding

+ +

While ruby-oauth tools are free software and will always be, the project would benefit immensely from some funding.
+Raising a monthly budget of… “dollars” would make the project more sustainable.

+ +

We welcome both individual and corporate sponsors! We also offer a
+wide array of funding channels to account for your preferences
+(although currently Open Collective is our preferred funding platform).

+ +

If you’re working in a company that’s making significant use of ruby-oauth tools we’d
+appreciate it if you suggest to your company to become a ruby-oauth sponsor.

+ +

You can support the development of ruby-oauth tools via
+GitHub Sponsors,
+Liberapay,
+PayPal,
+Open Collective
+and Tidelift.

+ + + + + + + + + + + + +
📍 NOTE
If doing a sponsorship in the form of donation is problematic for your company
from an accounting standpoint, we’d recommend the use of Tidelift,
where you can get a support-like subscription instead.
+ +

Open Collective for Individuals

+ +

Support us with a monthly donation and help us continue our activities. [Become a backer]

+ +

NOTE: kettle-readme-backers updates this list every day, automatically.

+ + +

No backers yet. Be the first!
+

+ +

Open Collective for Organizations

+ +

Become a sponsor and get your logo on our README on GitHub with a link to your site. [Become a sponsor]

+ +

NOTE: kettle-readme-backers updates this list every day, automatically.

+ + +

No sponsors yet. Be the first!
+

+ +

Another way to support open-source

+ +
+

How wonderful it is that nobody need wait a single moment before starting to improve the world.

+—Anne Frank

+
+ +

I’m driven by a passion to foster a thriving open-source community – a space where people can tackle complex problems, no matter how small. Revitalizing libraries that have fallen into disrepair, and building new libraries focused on solving real-world challenges, are my passions — totaling 79 hours of FLOSS coding over just the past seven days, a pretty regular week for me. I was recently affected by layoffs, and the tech jobs market is unwelcoming. I’m reaching out here because your support would significantly aid my efforts to provide for my family, and my farm (11 🐔 chickens, 2 🐶 dogs, 3 🐰 rabbits, 8 🐈‍ cats).

+ +

If you work at a company that uses my work, please encourage them to support me as a corporate sponsor. My work on gems you use might show up in bundle fund.

+ +

I’m developing a new library, floss_funding, designed to empower open-source developers like myself to get paid for the work we do, in a sustainable way. Please give it a look.

+ +

Floss-Funding.dev: 👉️ No network calls. 👉️ No tracking. 👉️ No oversight. 👉️ Minimal crypto hashing. 💡 Easily disabled nags

+ +

OpenCollective Backers OpenCollective Sponsors Sponsor Me on Github Liberapay Goal Progress Donate on PayPal Buy me a coffee Donate on Polar Donate to my FLOSS or refugee efforts at ko-fi.com Donate to my FLOSS or refugee efforts using Patreon

+ +

🔐 Security

+ +

See SECURITY.md.

+ +

🤝 Contributing

+ +

If you need some ideas of where to help, you could work on adding more code coverage,
+or if it is already 💯 (see below) check reek, issues, or PRs,
+or use the gem and think about how it could be better.

+ +

We Keep A Changelog so if you make changes, remember to update it.

+ +

See CONTRIBUTING.md for more detailed instructions.

+ +

🚀 Release Instructions

+ +

See CONTRIBUTING.md.

+ +

Code Coverage

+ +

Coverage Graph

+ +

Coveralls Test Coverage

+ +

QLTY Test Coverage

+ +

🪇 Code of Conduct

+ +

Everyone interacting with this project’s codebases, issue trackers,
+chat rooms and mailing lists agrees to follow the Contributor Covenant 2.1.

+ +

🌈 Contributors

+ +

Contributors

+ +

Made with contributors-img.

+ +

Also see GitLab Contributors: https://gitlab.com/ruby-oauth/oauth-tty/-/graphs/main

+ +
+ ⭐️ Star History + + + + + + Star History Chart + + + +
+ +

📌 Versioning

+ +

This Library adheres to Semantic Versioning 2.0.0.
+Violations of this scheme should be reported as bugs.
+Specifically, if a minor or patch version is released that breaks backward compatibility,
+a new version should be immediately released that restores compatibility.
+Breaking changes to the public API will only be introduced with new major versions.

+ +
+

dropping support for a platform is both obviously and objectively a breaking change

+—Jordan Harband (@ljharb, maintainer of SemVer) in SemVer issue 716

+
+ +

I understand that policy doesn’t work universally (“exceptions to every rule!”),
+but it is the policy here.
+As such, in many cases it is good to specify a dependency on this library using
+the Pessimistic Version Constraint with two digits of precision.

+ +

For example:

+ +
spec.add_dependency("oauth-tty", "~> 1.0")
+
+ +
+📌 Is "Platform Support" part of the public API? More details inside. + +SemVer should, IMO, but doesn't explicitly, say that dropping support for specific Platforms +is a *breaking change* to an API. +It is obvious to many, but not all, and since the spec is silent, the bike shedding is endless. + +To get a better understanding of how SemVer is intended to work over a project's lifetime, +read this article from the creator of SemVer: + +- ["Major Version Numbers are Not Sacred"][📌major-versions-not-sacred] + +
+ +

See CHANGELOG.md for a list of releases.

+ +

📄 License

+ +

The gem is available as open source under the terms of
+the MIT License License: MIT.
+See LICENSE.txt for the official Copyright Notice.

+ + + + + +

🤑 A request for help

+ +

Maintainers have teeth and need to pay their dentists.
+After getting laid off in an RIF in March and filled with many dozens of rejections,
+I’m now spending ~60+ hours a week building open source tools.
+I’m hoping to be able to pay for my kids’ health insurance this month,
+so if you value the work I am doing, I need your support.
+Please consider sponsoring me or the project.

+ +

To join the community or get help 👇️ Join the Discord.

+ +

Live Chat on Discord

+ +

To say “thanks!” ☝️ Join the Discord or 👇️ send money.

+ +

Sponsor ruby-oauth/oauth-tty on Open Source Collective 💌 Sponsor me on GitHub Sponsors 💌 Sponsor me on Liberapay 💌 Donate on PayPal

+ +

Please give the project a star ⭐ ♥.

+ +

Thanks for RTFM. ☺️

+ + + + + + + + \ No newline at end of file diff --git a/docs/file.RUBOCOP.html b/docs/file.RUBOCOP.html new file mode 100644 index 0000000..556e589 --- /dev/null +++ b/docs/file.RUBOCOP.html @@ -0,0 +1,171 @@ + + + + + + + File: RUBOCOP + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

RuboCop Usage Guide

+ +

Overview

+ +

A tale of two RuboCop plugin gems.

+ +

RuboCop Gradual

+ +

This project uses rubocop_gradual instead of vanilla RuboCop for code style checking. The rubocop_gradual tool allows for gradual adoption of RuboCop rules by tracking violations in a lock file.

+ +

RuboCop LTS

+ +

This project uses rubocop-lts to ensure, on a best-effort basis, compatibility with Ruby >= 1.9.2.
+RuboCop rules are meticulously configured by the rubocop-lts family of gems to ensure that a project is compatible with a specific version of Ruby. See: https://rubocop-lts.gitlab.io for more.

+ +

Checking RuboCop Violations

+ +

To check for RuboCop violations in this project, always use:

+ +
bundle exec rake rubocop_gradual:check
+
+ +

Do not use the standard RuboCop commands like:

+
    +
  • bundle exec rubocop
  • +
  • rubocop
  • +
+ +

Understanding the Lock File

+ +

The .rubocop_gradual.lock file tracks all current RuboCop violations in the project. This allows the team to:

+ +
    +
  1. Prevent new violations while gradually fixing existing ones
  2. +
  3. Track progress on code style improvements
  4. +
  5. Ensure CI builds don’t fail due to pre-existing violations
  6. +
+ +

Common Commands

+ +
    +
  • +Check violations +
      +
    • bundle exec rake rubocop_gradual
    • +
    • bundle exec rake rubocop_gradual:check
    • +
    +
  • +
  • +(Safe) Autocorrect violations, and update lockfile if no new violations +
      +
    • bundle exec rake rubocop_gradual:autocorrect
    • +
    +
  • +
  • +Force update the lock file (w/o autocorrect) to match violations present in code +
      +
    • bundle exec rake rubocop_gradual:force_update
    • +
    +
  • +
+ +

Workflow

+ +
    +
  1. Before submitting a PR, run bundle exec rake rubocop_gradual:autocorrect
    +a. or just the default bundle exec rake, as autocorrection is a pre-requisite of the default task.
  2. +
  3. If there are new violations, either: +
      +
    • Fix them in your code
    • +
    • Run bundle exec rake rubocop_gradual:force_update to update the lock file (only for violations you can’t fix immediately)
    • +
    +
  4. +
  5. Commit the updated .rubocop_gradual.lock file along with your changes
  6. +
+ +

Never add inline RuboCop disables

+ +

Do not add inline rubocop:disable / rubocop:enable comments anywhere in the codebase (including specs, except when following the few existing rubocop:disable patterns for a rule already being disabled elsewhere in the code). We handle exceptions in two supported ways:

+ +
    +
  • Permanent/structural exceptions: prefer adjusting the RuboCop configuration (e.g., in .rubocop.yml) to exclude a rule for a path or file pattern when it makes sense project-wide.
  • +
  • Temporary exceptions while improving code: record the current violations in .rubocop_gradual.lock via the gradual workflow: +
      +
    • +bundle exec rake rubocop_gradual:autocorrect (preferred; will autocorrect what it can and update the lock only if no new violations were introduced)
    • +
    • If needed, bundle exec rake rubocop_gradual:force_update (as a last resort when you cannot fix the newly reported violations immediately)
    • +
    +
  • +
+ +

In general, treat the rules as guidance to follow; fix violations rather than ignore them. For example, RSpec conventions in this project expect described_class to be used in specs that target a specific class under test.

+ +

Benefits of rubocop_gradual

+ +
    +
  • Allows incremental adoption of code style rules
  • +
  • Prevents CI failures due to pre-existing violations
  • +
  • Provides a clear record of code style debt
  • +
  • Enables focused efforts on improving code quality over time
  • +
+
+ + + +
+ + \ No newline at end of file diff --git a/docs/file.SECURITY.html b/docs/file.SECURITY.html new file mode 100644 index 0000000..6675274 --- /dev/null +++ b/docs/file.SECURITY.html @@ -0,0 +1,101 @@ + + + + + + + File: SECURITY + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Security Policy

+ +

Supported Versions

+ + + + + + + + + + + + + + +
VersionSupported
1.latest
+ +

Security contact information

+ +

To report a security vulnerability, please use the
+Tidelift security contact.
+Tidelift will coordinate the fix and disclosure.

+ +

Additional Support

+ +

If you are interested in support for versions older than the latest release,
+please consider sponsoring the project / maintainer @ https://liberapay.com/pboling/donate,
+or find other sponsorship links in the README.

+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/file_list.html b/docs/file_list.html new file mode 100644 index 0000000..95fe779 --- /dev/null +++ b/docs/file_list.html @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + File List + + + +
+
+

File List

+ + + +
+ + +
+ + diff --git a/docs/frames.html b/docs/frames.html new file mode 100644 index 0000000..6586005 --- /dev/null +++ b/docs/frames.html @@ -0,0 +1,22 @@ + + + + + Documentation by YARD 0.9.37 + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..bed5607 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,665 @@ + + + + + + + File: README + + — Documentation by YARD 0.9.37 + + + + + + + + + + + + + + + + + + + +
+ + +

Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0 ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5 oauth Logo by Chris Messina, CC BY-SA 3.0

+ +

🖥️ OAuth::TTY

+ +

Version GitHub tag (latest SemVer) License: MIT Downloads Rank Open Source Helpers CodeCov Test Coverage Coveralls Test Coverage QLTY Test Coverage QLTY Maintainability CI Heads CI Runtime Dependencies @ HEAD CI Current CI Truffle Ruby CI JRuby Deps Locked Deps Unlocked CI Supported CI Legacy CI Unsupported CI Ancient CI Test Coverage CI Style CodeQL Apache SkyWalking Eyes License Compatibility Check

+ +

if ci_badges.map(&:color).detect { it != "green"} ☝️ let me know, as I may have missed the discord notification.

+ +
+ +

if ci_badges.map(&:color).all? { it == "green"} 👇️ send money so I can do more of this. FLOSS maintenance is now my full-time job.

+ +

OpenCollective Backers OpenCollective Sponsors Sponsor Me on Github Liberapay Goal Progress Donate on PayPal Buy me a coffee Donate on Polar Donate at ko-fi.com

+ +

🌻 Synopsis

+ +

OAuth 1.0a is an industry-standard protocol for authorization.
+It is an update to the original OAuth 1.0 protocol, and is used by many popular services.

+ +

This RubyGem provides a CLI for OAuth 1.0 or 1.0a clients and servers in Ruby applications.
+See the sibling oauth2 gem for OAuth 2.0, 2.1, & OIDC clients in Ruby.

+ +

All dependencies of this gem are signed, so it can be installed with a HighSecurity profile.

+ + + +

💡 Info you can shake a stick at

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Tokens to Remember +Gem name Gem namespace +
Works with JRuby +JRuby 9.1 Compat JRuby 9.2 Compat JRuby 9.3 Compat
JRuby 9.4 Compat JRuby 10.0 Compat JRuby HEAD Compat +
Works with Truffle Ruby +Truffle Ruby 22.3 Compat Truffle Ruby 23.0 Compat
Truffle Ruby 23.1 Compat Truffle Ruby 24.1 Compat +
Works with MRI Ruby 3 +Ruby 3.0 Compat Ruby 3.1 Compat Ruby 3.2 Compat Ruby 3.3 Compat Ruby 3.4 Compat Ruby HEAD Compat +
Works with MRI Ruby 2 +Ruby 2.3 Compat Ruby 2.4 Compat Ruby 2.5 Compat Ruby 2.6 Compat Ruby 2.7 Compat +
Support & Community +Join Me on Daily.dev's RubyFriends Live Chat on Discord Get help from me on Upwork Get help from me on Codementor +
Source +Source on GitLab.com Source on CodeBerg.org Source on Github.com The best SHA: dQw4w9WgXcQ! +
Documentation +Current release on RubyDoc.info YARD on Galtzo.com Maintainer Blog GitLab Wiki GitHub Wiki +
Compliance +License: MIT Compatible with Apache Software Projects: Verified by SkyWalking Eyes 📄ilo-declaration-img Security Policy Contributor Covenant 2.1 SemVer 2.0.0 +
Style +Enforced Code Style Linter Keep-A-Changelog 1.0.0 Gitmoji Commits Compatibility appraised by: appraisal2 +
Maintainer 🎖️ +Follow Me on LinkedIn Follow Me on Ruby.Social Follow Me on Bluesky Contact Maintainer My technical writing +
+... 💖 +Find Me on WellFound: Find Me on CrunchBase My LinkTree More About Me 🧊 🐙 🛖 🧪 +
+ +

Compatibility

+ +

Compatible with MRI Ruby 2.3.0+, and concordant releases of JRuby, and TruffleRuby.

+ + + + + + + + + + + + + + +
🚚 Amazing test matrix was brought to you by🔎 appraisal2 🔎 and the color 💚 green 💚
👟 Check it out!github.com/appraisal-rb/appraisal2
+ +

Federated DVCS

+ +
+ Find this repo on federated forges (Coming soon!) + +| Federated [DVCS][💎d-in-dvcs] Repository | Status | Issues | PRs | Wiki | CI | Discussions | +|-------------------------------------------------|-----------------------------------------------------------------------|---------------------------|--------------------------|---------------------------|--------------------------|------------------------------| +| 🧪 [ruby-oauth/oauth-tty on GitLab][📜src-gl] | The Truth | [💚][🤝gl-issues] | [💚][🤝gl-pulls] | [💚][📜gl-wiki] | 🐭 Tiny Matrix | ➖ | +| 🧊 [ruby-oauth/oauth-tty on CodeBerg][📜src-cb] | An Ethical Mirror ([Donate][🤝cb-donate]) | [💚][🤝cb-issues] | [💚][🤝cb-pulls] | ➖ | ⭕️ No Matrix | ➖ | +| 🐙 [ruby-oauth/oauth-tty on GitHub][📜src-gh] | Another Mirror | [💚][🤝gh-issues] | [💚][🤝gh-pulls] | [💚][📜gh-wiki] | 💯 Full Matrix | [💚][gh-discussions] | +| 🤼 [OAuth Ruby Google Group][⛳gg-discussions] | "Active" | ➖ | ➖ | ➖ | ➖ | [💚][⛳gg-discussions] | +| 🎮️ [Discord Server][✉️discord-invite] | [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite] | [Let's][✉️discord-invite] | [talk][✉️discord-invite] | [about][✉️discord-invite] | [this][✉️discord-invite] | [library!][✉️discord-invite] | + +
+ +

Enterprise Support Tidelift +

+ +

Available as part of the Tidelift Subscription.

+ +
+ Need enterprise-level guarantees? + +The maintainers of this and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. + +[![Get help from me on Tidelift][🏙️entsup-tidelift-img]][🏙️entsup-tidelift] + +- 💡Subscribe for support guarantees covering _all_ your FLOSS dependencies +- 💡Tidelift is part of [Sonar][🏙️entsup-tidelift-sonar] +- 💡Tidelift pays maintainers to maintain the software you depend on!
📊`@`Pointy Haired Boss: An [enterprise support][🏙️entsup-tidelift] subscription is "[never gonna let you down][🧮kloc]", and *supports* open source maintainers + +Alternatively: + +- [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite] +- [![Get help from me on Upwork][👨🏼‍🏫expsup-upwork-img]][👨🏼‍🏫expsup-upwork] +- [![Get help from me on Codementor][👨🏼‍🏫expsup-codementor-img]][👨🏼‍🏫expsup-codementor] + +
+ +

✨ Installation

+ +

Install the gem and add to the application’s Gemfile by executing:

+ +
bundle add oauth-tty
+
+ +

If bundler is not being used to manage dependencies, install the gem by executing:

+ +
gem install oauth-tty
+
+ +

🔒 Secure Installation

+ +
+ For Medium or High Security Installations + +This gem is cryptographically signed, and has verifiable [SHA-256 and SHA-512][💎SHA_checksums] checksums by +[stone_checksums][💎stone_checksums]. Be sure the gem you install hasn’t been tampered with +by following the instructions below. + +Add my public key (if you haven’t already, expires 2045-04-29) as a trusted certificate: + +```console +gem cert --add <(curl -Ls https://raw.github.com/galtzo-floss/certs/main/pboling.pem) +``` + +You only need to do that once. Then proceed to install with: + +```console +gem install oauth-tty -P HighSecurity +``` + +The `HighSecurity` trust profile will verify signed gems, and not allow the installation of unsigned dependencies. + +If you want to up your security game full-time: + +```console +bundle config set --global trust-policy MediumSecurity +``` + +`MediumSecurity` instead of `HighSecurity` is necessary if not all the gems you use are signed. + +NOTE: Be prepared to track down certs for signed gems and add them the same way you added mine. + +
+ +

⚙️ Configuration

+ +

The oauth-tty gem is a thin CLI over the oauth gem. You supply your consumer credentials, token credentials (when applicable), a target URI, and optional parameters, and the tool signs requests or helps you complete an OAuth 1.0/1.0a 3-legged flow.

+ +

What you can configure

+
    +
  • Locations for OAuth parameters: +
      +
    • –header (default): send OAuth params in Authorization header
    • +
    • –body: send OAuth params in the request body
    • +
    • –query-string: send OAuth params on the query string
    • +
    +
  • +
  • + + + + + + + + + + +
    HTTP method: –method GETPOSTPUTDELETE… (default: POST)
    +
  • +
  • + + + + + + + + +
    Signature method: –signature-method HMAC-SHA1RSA-SHA1PLAINTEXT (default: HMAC-SHA1)
    +
  • +
  • OAuth version: –version 1.0 (default: 1.0) or –no-version to omit
  • +
  • Nonce/timestamp: auto-generated by default; can be overridden via –nonce and –timestamp
  • +
  • Verbose output: –verbose prints the full signing breakdown, headers, and signature base string
  • +
  • XMPP mode: –xmpp emits OAuth as an XMPP stanza instead of HTTP artifacts
  • +
+ +

Required inputs (by command)

+
    +
  • sign, query: –consumer-key, –consumer-secret, –token, –secret, and –uri
  • +
  • authorize: –consumer-key, –consumer-secret, the OAuth endpoints below, and –uri (service resource you’re authorizing for)
  • +
+ +

Authorization endpoints (for oauth authorize)

+
    +
  • –request-token-url URL
  • +
  • –authorize-url URL
  • +
  • –access-token-url URL
  • +
  • Optional: –callback-url URL (for 1.0a), –scope SCOPE (provider-specific)
  • +
+ +

Providing options

+
    +
  • CLI flags (preferred for quick usage)
  • +
  • Options file: use -O or –options to read additional arguments from a file. The file is tokenized by whitespace; put the same flags you’d pass on the command line, spread across lines as needed.
  • +
+ +

Example options file (oauth.opts)

+
--consumer-key ck_123
+--consumer-secret cs_456
+--token at_789
+--secret ats_abc
+--method GET
+--uri https://api.example.com/v1/profile
+--parameters foo:bar
+--parameters "status=active"
+--header
+
+

Run with: oauth sign -O oauth.opts

+ +

Defaults at a glance

+
    +
  • scheme: header
  • +
  • method: POST
  • +
  • signature method: HMAC-SHA1
  • +
  • oauth_version: 1.0 (omit with –no-version)
  • +
  • nonce, timestamp: auto-generated each run
  • +
+ +

Tips

+
    +
  • For parameters you can use either key:value or already-escaped pairs like key=value. Repeat –parameters to add multiple pairs.
  • +
  • When using –body, only methods that support bodies should be used (e.g., POST/PUT/PATCH).
  • +
  • Some providers require exact parameter ordering and inclusion; use –verbose to see normalized parameters and the signature base string.
  • +
+ +

🔧 Basic Usage

+ +

In a shell run oauth to start the console.

+ +

Quick help and version

+
oauth --help
+oauth --version  # or oauth -v
+
+ +

Sign a request (minimal)
+Print just the OAuth signature value for a GET request:

+
oauth sign \
+  --consumer-key ck \
+  --consumer-secret cs \
+  --token at \
+  --secret ats \
+  --method GET \
+  --uri "https://api.example.com/v1/resource?limit=10"
+
+ +

Sign a request (verbose, header output)

+
oauth sign \
+  --consumer-key ck \
+  --consumer-secret cs \
+  --token at \
+  --secret ats \
+  --method POST \
+  --uri https://api.example.com/v1/resource \
+  --parameters "status=active" \
+  --header \
+  --verbose
+
+

This prints OAuth parameters, normalized parameters, signature base string, Authorization header, and both raw and escaped signatures.

+ +

Query a protected resource
+Performs the signed HTTP request and prints the HTTP status and body.

+
oauth query \
+  --consumer-key ck \
+  --consumer-secret cs \
+  --token at \
+  --secret ats \
+  --method GET \
+  --uri https://api.example.com/v1/profile \
+  --parameters "fields=id,name"
+
+

Notes:

+
    +
  • The CLI will append any –parameters to the request URI’s query string and sign the request.
  • +
  • Use –body or –header/–query-string to influence where OAuth params go; query also constructs OAuth via the consumer internally.
  • +
+ +

Start an OAuth 1.0a authorization flow
+Guides you to obtain an access token and token secret from a provider.

+
oauth authorize \
+  --consumer-key ck \
+  --consumer-secret cs \
+  --request-token-url https://provider.example.com/oauth/request_token \
+  --authorize-url https://provider.example.com/oauth/authorize \
+  --access-token-url https://provider.example.com/oauth/access_token \
+  --callback-url https://yourapp.example.com/oauth/callback
+
+

What happens:

+
    +
  • You’ll be shown an authorization URL to open in a browser.
  • +
  • After approving, the provider shows a verifier (PIN). Paste it back into the prompt.
  • +
  • The tool prints the access token and secret under “Response:”. Save those and use them with sign/query.
  • +
+ +

Using an options file

+
oauth sign -O oauth.opts
+
+

You can still add/override flags after -O; later flags win.

+ +

For more examples

+
    +
  • Run any command without args to see its specific help.
  • +
  • Browse the specs under spec/oauth/tty for additional scenarios and edge cases.
  • +
+ +

In a shell run oauth to start the console.

+ +

For now, please see the tests for other usage.

+ +

🦷 FLOSS Funding

+ +

While ruby-oauth tools are free software and will always be, the project would benefit immensely from some funding.
+Raising a monthly budget of… “dollars” would make the project more sustainable.

+ +

We welcome both individual and corporate sponsors! We also offer a
+wide array of funding channels to account for your preferences
+(although currently Open Collective is our preferred funding platform).

+ +

If you’re working in a company that’s making significant use of ruby-oauth tools we’d
+appreciate it if you suggest to your company to become a ruby-oauth sponsor.

+ +

You can support the development of ruby-oauth tools via
+GitHub Sponsors,
+Liberapay,
+PayPal,
+Open Collective
+and Tidelift.

+ + + + + + + + + + + + +
📍 NOTE
If doing a sponsorship in the form of donation is problematic for your company
from an accounting standpoint, we’d recommend the use of Tidelift,
where you can get a support-like subscription instead.
+ +

Open Collective for Individuals

+ +

Support us with a monthly donation and help us continue our activities. [Become a backer]

+ +

NOTE: kettle-readme-backers updates this list every day, automatically.

+ + +

No backers yet. Be the first!
+

+ +

Open Collective for Organizations

+ +

Become a sponsor and get your logo on our README on GitHub with a link to your site. [Become a sponsor]

+ +

NOTE: kettle-readme-backers updates this list every day, automatically.

+ + +

No sponsors yet. Be the first!
+

+ +

Another way to support open-source

+ +
+

How wonderful it is that nobody need wait a single moment before starting to improve the world.

+—Anne Frank

+
+ +

I’m driven by a passion to foster a thriving open-source community – a space where people can tackle complex problems, no matter how small. Revitalizing libraries that have fallen into disrepair, and building new libraries focused on solving real-world challenges, are my passions — totaling 79 hours of FLOSS coding over just the past seven days, a pretty regular week for me. I was recently affected by layoffs, and the tech jobs market is unwelcoming. I’m reaching out here because your support would significantly aid my efforts to provide for my family, and my farm (11 🐔 chickens, 2 🐶 dogs, 3 🐰 rabbits, 8 🐈‍ cats).

+ +

If you work at a company that uses my work, please encourage them to support me as a corporate sponsor. My work on gems you use might show up in bundle fund.

+ +

I’m developing a new library, floss_funding, designed to empower open-source developers like myself to get paid for the work we do, in a sustainable way. Please give it a look.

+ +

Floss-Funding.dev: 👉️ No network calls. 👉️ No tracking. 👉️ No oversight. 👉️ Minimal crypto hashing. 💡 Easily disabled nags

+ +

OpenCollective Backers OpenCollective Sponsors Sponsor Me on Github Liberapay Goal Progress Donate on PayPal Buy me a coffee Donate on Polar Donate to my FLOSS or refugee efforts at ko-fi.com Donate to my FLOSS or refugee efforts using Patreon

+ +

🔐 Security

+ +

See SECURITY.md.

+ +

🤝 Contributing

+ +

If you need some ideas of where to help, you could work on adding more code coverage,
+or if it is already 💯 (see below) check reek, issues, or PRs,
+or use the gem and think about how it could be better.

+ +

We Keep A Changelog so if you make changes, remember to update it.

+ +

See CONTRIBUTING.md for more detailed instructions.

+ +

🚀 Release Instructions

+ +

See CONTRIBUTING.md.

+ +

Code Coverage

+ +

Coverage Graph

+ +

Coveralls Test Coverage

+ +

QLTY Test Coverage

+ +

🪇 Code of Conduct

+ +

Everyone interacting with this project’s codebases, issue trackers,
+chat rooms and mailing lists agrees to follow the Contributor Covenant 2.1.

+ +

🌈 Contributors

+ +

Contributors

+ +

Made with contributors-img.

+ +

Also see GitLab Contributors: https://gitlab.com/ruby-oauth/oauth-tty/-/graphs/main

+ +
+ ⭐️ Star History + + + + + + Star History Chart + + + +
+ +

📌 Versioning

+ +

This Library adheres to Semantic Versioning 2.0.0.
+Violations of this scheme should be reported as bugs.
+Specifically, if a minor or patch version is released that breaks backward compatibility,
+a new version should be immediately released that restores compatibility.
+Breaking changes to the public API will only be introduced with new major versions.

+ +
+

dropping support for a platform is both obviously and objectively a breaking change

+—Jordan Harband (@ljharb, maintainer of SemVer) in SemVer issue 716

+
+ +

I understand that policy doesn’t work universally (“exceptions to every rule!”),
+but it is the policy here.
+As such, in many cases it is good to specify a dependency on this library using
+the Pessimistic Version Constraint with two digits of precision.

+ +

For example:

+ +
spec.add_dependency("oauth-tty", "~> 1.0")
+
+ +
+📌 Is "Platform Support" part of the public API? More details inside. + +SemVer should, IMO, but doesn't explicitly, say that dropping support for specific Platforms +is a *breaking change* to an API. +It is obvious to many, but not all, and since the spec is silent, the bike shedding is endless. + +To get a better understanding of how SemVer is intended to work over a project's lifetime, +read this article from the creator of SemVer: + +- ["Major Version Numbers are Not Sacred"][📌major-versions-not-sacred] + +
+ +

See CHANGELOG.md for a list of releases.

+ +

📄 License

+ +

The gem is available as open source under the terms of
+the MIT License License: MIT.
+See LICENSE.txt for the official Copyright Notice.

+ + + + + +

🤑 A request for help

+ +

Maintainers have teeth and need to pay their dentists.
+After getting laid off in an RIF in March and filled with many dozens of rejections,
+I’m now spending ~60+ hours a week building open source tools.
+I’m hoping to be able to pay for my kids’ health insurance this month,
+so if you value the work I am doing, I need your support.
+Please consider sponsoring me or the project.

+ +

To join the community or get help 👇️ Join the Discord.

+ +

Live Chat on Discord

+ +

To say “thanks!” ☝️ Join the Discord or 👇️ send money.

+ +

Sponsor ruby-oauth/oauth-tty on Open Source Collective 💌 Sponsor me on GitHub Sponsors 💌 Sponsor me on Liberapay 💌 Donate on PayPal

+ +

Please give the project a star ⭐ ♥.

+ +

Thanks for RTFM. ☺️

+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/js/app.js b/docs/js/app.js new file mode 100644 index 0000000..b5610ef --- /dev/null +++ b/docs/js/app.js @@ -0,0 +1,344 @@ +(function () { + var localStorage = {}, + sessionStorage = {}; + try { + localStorage = window.localStorage; + } catch (e) {} + try { + sessionStorage = window.sessionStorage; + } catch (e) {} + + function createSourceLinks() { + $(".method_details_list .source_code").before( + "[View source]" + ); + $(".toggleSource").toggle( + function () { + $(this).parent().nextAll(".source_code").slideDown(100); + $(this).text("Hide source"); + }, + function () { + $(this).parent().nextAll(".source_code").slideUp(100); + $(this).text("View source"); + } + ); + } + + function createDefineLinks() { + var tHeight = 0; + $(".defines").after(" more..."); + $(".toggleDefines").toggle( + function () { + tHeight = $(this).parent().prev().height(); + $(this).prev().css("display", "inline"); + $(this).parent().prev().height($(this).parent().height()); + $(this).text("(less)"); + }, + function () { + $(this).prev().hide(); + $(this).parent().prev().height(tHeight); + $(this).text("more..."); + } + ); + } + + function createFullTreeLinks() { + var tHeight = 0; + $(".inheritanceTree").toggle( + function () { + tHeight = $(this).parent().prev().height(); + $(this).parent().toggleClass("showAll"); + $(this).text("(hide)"); + $(this).parent().prev().height($(this).parent().height()); + }, + function () { + $(this).parent().toggleClass("showAll"); + $(this).parent().prev().height(tHeight); + $(this).text("show all"); + } + ); + } + + function searchFrameButtons() { + $(".full_list_link").click(function () { + toggleSearchFrame(this, $(this).attr("href")); + return false; + }); + window.addEventListener("message", function (e) { + if (e.data === "navEscape") { + $("#nav").slideUp(100); + $("#search a").removeClass("active inactive"); + $(window).focus(); + } + }); + + $(window).resize(function () { + if ($("#search:visible").length === 0) { + $("#nav").removeAttr("style"); + $("#search a").removeClass("active inactive"); + $(window).focus(); + } + }); + } + + function toggleSearchFrame(id, link) { + var frame = $("#nav"); + $("#search a").removeClass("active").addClass("inactive"); + if (frame.attr("src") === link && frame.css("display") !== "none") { + frame.slideUp(100); + $("#search a").removeClass("active inactive"); + } else { + $(id).addClass("active").removeClass("inactive"); + if (frame.attr("src") !== link) frame.attr("src", link); + frame.slideDown(100); + } + } + + function linkSummaries() { + $(".summary_signature").click(function () { + document.location = $(this).find("a").attr("href"); + }); + } + + function summaryToggle() { + $(".summary_toggle").click(function (e) { + e.preventDefault(); + localStorage.summaryCollapsed = $(this).text(); + $(".summary_toggle").each(function () { + $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); + var next = $(this).parent().parent().nextAll("ul.summary").first(); + if (next.hasClass("compact")) { + next.toggle(); + next.nextAll("ul.summary").first().toggle(); + } else if (next.hasClass("summary")) { + var list = $('