Internal error raised to when a timeout is triggered.
Not a URI
.
Not a URI
component.
An internal representation of the backtrace. The user will never interact with objects of this class directly, but class methods can be used to get backtrace settings of the current session.
This module provides instance methods for a digest implementation object to calculate message digest values.
Adds basic type aliases to the including class for use with Fiddle::Importer
.
The aliases added are uint
and u_int
(unsigned int
) and ulong
and u_long
(unsigned long
)
Use SSLContext
to set up the parameters for a TLS (former SSL
) connection. Both client and server TLS connections are supported, SSLSocket
and SSLServer
may be used in conjunction with an instance of SSLContext
to set up connections.
Net::HTTP
exception class. You cannot use Net::HTTPExceptions
directly; instead, you must use its subclasses.
Acceptable argument classes. Now contains DecimalInteger, OctalInteger and DecimalNumeric. See Acceptable argument classes (in source code).
The DSL
module provides a set of methods that can be used to create prism nodes in a more concise manner. For example, instead of writing:
source = Prism::Source.new("[1]") Prism::ArrayNode.new( [ Prism::IntegerNode.new( Prism::IntegerBaseFlags::DECIMAL, Prism::Location.new(source, 1, 1), ) ], Prism::Location.new(source, 0, 1), Prism::Location.new(source, 2, 1) )
you could instead write:
source = Prism::Source.new("[1]") ArrayNode( IntegerNode(Prism::IntegerBaseFlags::DECIMAL, Location(source, 1, 1))), Location(source, 0, 1), Location(source, 2, 1) )
This is mostly helpful in the context of writing tests, but can also be used to generate trees programmatically.
A module responsible for deserializing parse results.
Utility methods for using the RubyGems API.
The WebauthnListener
class retrieves an OTP after a user successfully WebAuthns with the Gem host. An instance opens a socket using the TCPServer
instance given and listens for a request from the Gem host. The request should be a GET request to the root path and contains the OTP code in the form of a query parameter ‘code`. The listener will return the code which will be used as the OTP for API requests.
Types of responses sent by the listener after receiving a request:
- 200 OK: OTP code was successfully retrieved - 204 No Content: If the request was an OPTIONS request - 400 Bad Request: If the request did not contain a query parameter `code` - 404 Not Found: The request was not to the root path - 405 Method Not Allowed: OTP code was not retrieved because the request was not a GET/OPTIONS request
Example usage:
thread = Gem::WebauthnListener.listener_thread("https://rubygems.example", server) thread.join otp = thread[:otp] error = thread[:error]
The WebauthnListener
Response class is used by the WebauthnListener
to create responses to be sent to the Gem host. It creates a Gem::Net::HTTPResponse instance when initialized and can be converted to the appropriate format to be sent by a socket using ‘to_s`. Gem::Net::HTTPResponse instances cannot be directly sent over a socket.
Types of response classes:
- OkResponse - NoContentResponse - BadRequestResponse - NotFoundResponse - MethodNotAllowedResponse
Example usage:
server = TCPServer.new(0) socket = server.accept response = OkResponse.for("https://rubygems.example") socket.print response.to_s socket.close
The WebauthnPoller
class retrieves an OTP after a user successfully WebAuthns. An instance polls the Gem host for the OTP code. The polling request (api/v1/webauthn_verification/<webauthn_token>/status.json) is sent to the Gem host every 5 seconds and will timeout after 5 minutes. If the status field in the json response is “success”, the code field will contain the OTP code.
Example usage:
thread = Gem::WebauthnPoller.poll_thread( {}, "RubyGems.org", "https://rubygems.org/api/v1/webauthn_verification/odow34b93t6aPCdY", { email: "email@example.com", password: "password" } ) thread.join otp = thread[:otp] error = thread[:error]
A stub yaml serializer that can handle only hashes and strings (as of now).
An SSLContext
is used to set various options regarding certificates, algorithms, verification, session caching, etc. The SSLContext
is used to create an SSLSocket
.
All attributes must be set before creating an SSLSocket
as the SSLContext
will be frozen afterward.
SSLServer
represents a TCP/IP server socket with Secure Sockets Layer.
An OpenSSL::OCSP::BasicResponse
contains the status of a certificate check which is created from an OpenSSL::OCSP::Request
. A BasicResponse
is more detailed than a Response
.
Generic error class raised by SSLSocket
and SSLContext
.