Sha256: 60b6aae04749c9c29b26edfa59d667d78288c5d674aef1e299a7960c4b32b77a

Contents?: true

Size: 1.5 KB

Versions: 12

Compression:

Stored size: 1.5 KB

Contents

module HTTPX
  module Plugins
    #
    # https://gitlab.com/os85/httpx/wikis/OAuth
    #
    module OAuth
      def self.load_dependencies: (singleton(Session) klass) -> void

      type grant_type = "client_credentials" | "refresh_token"

      type token_auth_method = "client_secret_basic" | "client_secret_post"

      SUPPORTED_GRANT_TYPES: ::Array[grant_type]

      SUPPORTED_AUTH_METHODS: ::Array[token_auth_method]

      class OAuthSession
        attr_reader token_endpoint_auth_method: token_auth_method

        attr_reader grant_type: grant_type

        attr_reader client_id: String

        attr_reader client_secret: String

        attr_reader access_token: String?

        attr_reader refresh_token: String?

        attr_reader scope: Array[String]?

        def initialize: (issuer: uri, client_id: String, client_secret: String, ?access_token: String?, ?refresh_token: String?, ?scope: (Array[String] | String)?, ?token_endpoint: String?, ?response_type: String?, ?grant_type: String?, ?token_endpoint_auth_method: ::String) -> void

        def token_endpoint: () -> String

        def load: (Session http) -> void

        def merge: (instance | Hash[untyped, untyped] other) -> instance
      end

      interface _AwsSdkOptions
        def oauth_session: () -> OAuthSession?
      end

      module InstanceMethods
        def oauth_auth: (**untyped args) -> instance

        def with_access_token: () -> instance
      end
    end

    type sessionOAuth = Session & OAuth::InstanceMethods
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
httpx-1.2.2 sig/plugins/oauth.rbs
httpx-1.2.1 sig/plugins/oauth.rbs
httpx-1.2.0 sig/plugins/oauth.rbs
httpx-1.1.5 sig/plugins/oauth.rbs
httpx-1.1.4 sig/plugins/oauth.rbs
httpx-1.1.3 sig/plugins/oauth.rbs
httpx-1.1.2 sig/plugins/oauth.rbs
httpx-1.1.1 sig/plugins/oauth.rbs
httpx-1.1.0 sig/plugins/oauth.rbs
httpx-1.0.2 sig/plugins/oauth.rbs
httpx-1.0.1 sig/plugins/oauth.rbs
httpx-1.0.0 sig/plugins/oauth.rbs