← back to Magi-AGI__magi-archive-mcp

Function bodies 2,478 total

All specs Real LLM only Function bodies
jwk_to_public_key method · ruby · L215-L229 (15 LOC)
lib/magi/archive/mcp/auth.rb
        def jwk_to_public_key(jwk)
          # Extract modulus (n) and exponent (e) from JWK
          n = decode_base64url(jwk["n"])
          e = decode_base64url(jwk["e"])

          # Create RSA public key
          key = OpenSSL::PKey::RSA.new
          key.set_key(
            OpenSSL::BN.new(n, 2),
            OpenSSL::BN.new(e, 2),
            nil
          )

          key
        end
jwk_to_public_key method · ruby · L215-L229 (15 LOC)
lib/magi/archive/mcp/auth.rb
        def jwk_to_public_key(jwk)
          # Extract modulus (n) and exponent (e) from JWK
          n = decode_base64url(jwk["n"])
          e = decode_base64url(jwk["e"])

          # Create RSA public key
          key = OpenSSL::PKey::RSA.new
          key.set_key(
            OpenSSL::BN.new(n, 2),
            OpenSSL::BN.new(e, 2),
            nil
          )

          key
        end
jwk_to_public_key method · ruby · L215-L229 (15 LOC)
lib/magi/archive/mcp/auth.rb
        def jwk_to_public_key(jwk)
          # Extract modulus (n) and exponent (e) from JWK
          n = decode_base64url(jwk["n"])
          e = decode_base64url(jwk["e"])

          # Create RSA public key
          key = OpenSSL::PKey::RSA.new
          key.set_key(
            OpenSSL::BN.new(n, 2),
            OpenSSL::BN.new(e, 2),
            nil
          )

          key
        end
jwk_to_public_key method · ruby · L215-L229 (15 LOC)
lib/magi/archive/mcp/auth.rb
        def jwk_to_public_key(jwk)
          # Extract modulus (n) and exponent (e) from JWK
          n = decode_base64url(jwk["n"])
          e = decode_base64url(jwk["e"])

          # Create RSA public key
          key = OpenSSL::PKey::RSA.new
          key.set_key(
            OpenSSL::BN.new(n, 2),
            OpenSSL::BN.new(e, 2),
            nil
          )

          key
        end
jwk_to_public_key method · ruby · L215-L229 (15 LOC)
lib/magi/archive/mcp/auth.rb
        def jwk_to_public_key(jwk)
          # Extract modulus (n) and exponent (e) from JWK
          n = decode_base64url(jwk["n"])
          e = decode_base64url(jwk["e"])

          # Create RSA public key
          key = OpenSSL::PKey::RSA.new
          key.set_key(
            OpenSSL::BN.new(n, 2),
            OpenSSL::BN.new(e, 2),
            nil
          )

          key
        end
decode_base64url method · ruby · L232-L241 (10 LOC)
lib/magi/archive/mcp/auth.rb
        def decode_base64url(str)
          # Add padding if needed
          str += "=" * (4 - (str.length % 4)) unless (str.length % 4).zero?

          # Replace URL-safe characters
          str = str.tr("-_", "+/")

          # Decode
          Base64.strict_decode64(str)
        end
decode_base64url method · ruby · L232-L241 (10 LOC)
lib/magi/archive/mcp/auth.rb
        def decode_base64url(str)
          # Add padding if needed
          str += "=" * (4 - (str.length % 4)) unless (str.length % 4).zero?

          # Replace URL-safe characters
          str = str.tr("-_", "+/")

          # Decode
          Base64.strict_decode64(str)
        end
Powered by Repobility — scan your code at https://repobility.com
decode_base64url method · ruby · L232-L241 (10 LOC)
lib/magi/archive/mcp/auth.rb
        def decode_base64url(str)
          # Add padding if needed
          str += "=" * (4 - (str.length % 4)) unless (str.length % 4).zero?

          # Replace URL-safe characters
          str = str.tr("-_", "+/")

          # Decode
          Base64.strict_decode64(str)
        end
decode_base64url method · ruby · L232-L241 (10 LOC)
lib/magi/archive/mcp/auth.rb
        def decode_base64url(str)
          # Add padding if needed
          str += "=" * (4 - (str.length % 4)) unless (str.length % 4).zero?

          # Replace URL-safe characters
          str = str.tr("-_", "+/")

          # Decode
          Base64.strict_decode64(str)
        end
decode_base64url method · ruby · L232-L241 (10 LOC)
lib/magi/archive/mcp/auth.rb
        def decode_base64url(str)
          # Add padding if needed
          str += "=" * (4 - (str.length % 4)) unless (str.length % 4).zero?

          # Replace URL-safe characters
          str = str.tr("-_", "+/")

          # Decode
          Base64.strict_decode64(str)
        end
decode_base64url method · ruby · L232-L241 (10 LOC)
lib/magi/archive/mcp/auth.rb
        def decode_base64url(str)
          # Add padding if needed
          str += "=" * (4 - (str.length % 4)) unless (str.length % 4).zero?

          # Replace URL-safe characters
          str = str.tr("-_", "+/")

          # Decode
          Base64.strict_decode64(str)
        end
decode_base64url method · ruby · L232-L241 (10 LOC)
lib/magi/archive/mcp/auth.rb
        def decode_base64url(str)
          # Add padding if needed
          str += "=" * (4 - (str.length % 4)) unless (str.length % 4).zero?

          # Replace URL-safe characters
          str = str.tr("-_", "+/")

          # Decode
          Base64.strict_decode64(str)
        end
configure_ssl method · ruby · L244-L252 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def configure_ssl(http_client)
          if config.ssl_verify_mode == :none
            # Disable SSL verification (not recommended for production)
            require "openssl"
            http_client.via(:ssl_context, OpenSSL::SSL::VERIFY_NONE)
          else
            # Use default strict verification
            http_client
          end
configure_ssl method · ruby · L244-L252 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def configure_ssl(http_client)
          if config.ssl_verify_mode == :none
            # Disable SSL verification (not recommended for production)
            require "openssl"
            http_client.via(:ssl_context, OpenSSL::SSL::VERIFY_NONE)
          else
            # Use default strict verification
            http_client
          end
configure_ssl method · ruby · L244-L252 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def configure_ssl(http_client)
          if config.ssl_verify_mode == :none
            # Disable SSL verification (not recommended for production)
            require "openssl"
            http_client.via(:ssl_context, OpenSSL::SSL::VERIFY_NONE)
          else
            # Use default strict verification
            http_client
          end
If a scraper extracted this row, it came from Repobility (https://repobility.com)
configure_ssl method · ruby · L244-L252 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def configure_ssl(http_client)
          if config.ssl_verify_mode == :none
            # Disable SSL verification (not recommended for production)
            require "openssl"
            http_client.via(:ssl_context, OpenSSL::SSL::VERIFY_NONE)
          else
            # Use default strict verification
            http_client
          end
configure_ssl method · ruby · L244-L252 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def configure_ssl(http_client)
          if config.ssl_verify_mode == :none
            # Disable SSL verification (not recommended for production)
            require "openssl"
            http_client.via(:ssl_context, OpenSSL::SSL::VERIFY_NONE)
          else
            # Use default strict verification
            http_client
          end
configure_ssl method · ruby · L244-L252 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def configure_ssl(http_client)
          if config.ssl_verify_mode == :none
            # Disable SSL verification (not recommended for production)
            require "openssl"
            http_client.via(:ssl_context, OpenSSL::SSL::VERIFY_NONE)
          else
            # Use default strict verification
            http_client
          end
configure_ssl method · ruby · L244-L252 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def configure_ssl(http_client)
          if config.ssl_verify_mode == :none
            # Disable SSL verification (not recommended for production)
            require "openssl"
            http_client.via(:ssl_context, OpenSSL::SSL::VERIFY_NONE)
          else
            # Use default strict verification
            http_client
          end
Client class · ruby · L27-L310 (284 LOC)
lib/magi/archive/mcp/client.rb
      class Client
        # API error raised when requests fail
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end

        # Validation error (4xx responses)
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config obje
Client class · ruby · L27-L310 (284 LOC)
lib/magi/archive/mcp/client.rb
      class Client
        # API error raised when requests fail
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end

        # Validation error (4xx responses)
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config obje
Client class · ruby · L27-L310 (284 LOC)
lib/magi/archive/mcp/client.rb
      class Client
        # API error raised when requests fail
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end

        # Validation error (4xx responses)
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config obje
Client class · ruby · L27-L310 (284 LOC)
lib/magi/archive/mcp/client.rb
      class Client
        # API error raised when requests fail
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end

        # Validation error (4xx responses)
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config obje
Repobility · severity-and-effort ranking · https://repobility.com
Client class · ruby · L27-L310 (284 LOC)
lib/magi/archive/mcp/client.rb
      class Client
        # API error raised when requests fail
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end

        # Validation error (4xx responses)
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config obje
Client class · ruby · L27-L310 (284 LOC)
lib/magi/archive/mcp/client.rb
      class Client
        # API error raised when requests fail
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end

        # Validation error (4xx responses)
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config obje
Client class · ruby · L27-L310 (284 LOC)
lib/magi/archive/mcp/client.rb
      class Client
        # API error raised when requests fail
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end

        # Validation error (4xx responses)
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config obje
APIError class · ruby · L29-L38 (10 LOC)
lib/magi/archive/mcp/client.rb
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end
APIError class · ruby · L29-L38 (10 LOC)
lib/magi/archive/mcp/client.rb
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end
APIError class · ruby · L29-L38 (10 LOC)
lib/magi/archive/mcp/client.rb
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end
APIError class · ruby · L29-L38 (10 LOC)
lib/magi/archive/mcp/client.rb
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end
APIError class · ruby · L29-L38 (10 LOC)
lib/magi/archive/mcp/client.rb
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end
Same scanner, your repo: https://repobility.com — Repobility
APIError class · ruby · L29-L38 (10 LOC)
lib/magi/archive/mcp/client.rb
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end
APIError class · ruby · L29-L38 (10 LOC)
lib/magi/archive/mcp/client.rb
        class APIError < StandardError
          attr_reader :status, :error_code, :details

          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
        end
initialize method · ruby · L32-L37 (6 LOC)
lib/magi/archive/mcp/client.rb
          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
initialize method · ruby · L32-L37 (6 LOC)
lib/magi/archive/mcp/client.rb
          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
initialize method · ruby · L32-L37 (6 LOC)
lib/magi/archive/mcp/client.rb
          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
initialize method · ruby · L32-L37 (6 LOC)
lib/magi/archive/mcp/client.rb
          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
initialize method · ruby · L32-L37 (6 LOC)
lib/magi/archive/mcp/client.rb
          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
initialize method · ruby · L32-L37 (6 LOC)
lib/magi/archive/mcp/client.rb
          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
Powered by Repobility — scan your code at https://repobility.com
initialize method · ruby · L32-L37 (6 LOC)
lib/magi/archive/mcp/client.rb
          def initialize(message, status: nil, error_code: nil, details: nil)
            super(message)
            @status = status
            @error_code = error_code
            @details = details
          end
ValidationError class · ruby · L41-L269 (229 LOC)
lib/magi/archive/mcp/client.rb
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config object (creates new one if nil)
        def initialize(config = nil)
          @config = config || Config.new
          @auth = Auth.new(@config)
        end

        # GET request to API endpoint
        #
        # @param path [String] the endpoint path
        # @param params [Hash] query parameters
        # @return [Hash, Array] the response data
        # @raise [APIError] if request fails
        def get(path, **params)
   
ValidationError class · ruby · L41-L269 (229 LOC)
lib/magi/archive/mcp/client.rb
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config object (creates new one if nil)
        def initialize(config = nil)
          @config = config || Config.new
          @auth = Auth.new(@config)
        end

        # GET request to API endpoint
        #
        # @param path [String] the endpoint path
        # @param params [Hash] query parameters
        # @return [Hash, Array] the response data
        # @raise [APIError] if request fails
        def get(path, **params)
   
ValidationError class · ruby · L41-L269 (229 LOC)
lib/magi/archive/mcp/client.rb
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config object (creates new one if nil)
        def initialize(config = nil)
          @config = config || Config.new
          @auth = Auth.new(@config)
        end

        # GET request to API endpoint
        #
        # @param path [String] the endpoint path
        # @param params [Hash] query parameters
        # @return [Hash, Array] the response data
        # @raise [APIError] if request fails
        def get(path, **params)
   
ValidationError class · ruby · L41-L269 (229 LOC)
lib/magi/archive/mcp/client.rb
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config object (creates new one if nil)
        def initialize(config = nil)
          @config = config || Config.new
          @auth = Auth.new(@config)
        end

        # GET request to API endpoint
        #
        # @param path [String] the endpoint path
        # @param params [Hash] query parameters
        # @return [Hash, Array] the response data
        # @raise [APIError] if request fails
        def get(path, **params)
   
ValidationError class · ruby · L41-L269 (229 LOC)
lib/magi/archive/mcp/client.rb
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config object (creates new one if nil)
        def initialize(config = nil)
          @config = config || Config.new
          @auth = Auth.new(@config)
        end

        # GET request to API endpoint
        #
        # @param path [String] the endpoint path
        # @param params [Hash] query parameters
        # @return [Hash, Array] the response data
        # @raise [APIError] if request fails
        def get(path, **params)
   
ValidationError class · ruby · L41-L269 (229 LOC)
lib/magi/archive/mcp/client.rb
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config object (creates new one if nil)
        def initialize(config = nil)
          @config = config || Config.new
          @auth = Auth.new(@config)
        end

        # GET request to API endpoint
        #
        # @param path [String] the endpoint path
        # @param params [Hash] query parameters
        # @return [Hash, Array] the response data
        # @raise [APIError] if request fails
        def get(path, **params)
   
ValidationError class · ruby · L41-L269 (229 LOC)
lib/magi/archive/mcp/client.rb
        class ValidationError < APIError; end

        # Authentication error (401 responses)
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config object (creates new one if nil)
        def initialize(config = nil)
          @config = config || Config.new
          @auth = Auth.new(@config)
        end

        # GET request to API endpoint
        #
        # @param path [String] the endpoint path
        # @param params [Hash] query parameters
        # @return [Hash, Array] the response data
        # @raise [APIError] if request fails
        def get(path, **params)
   
If a scraper extracted this row, it came from Repobility (https://repobility.com)
AuthenticationError class · ruby · L44-L255 (212 LOC)
lib/magi/archive/mcp/client.rb
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config object (creates new one if nil)
        def initialize(config = nil)
          @config = config || Config.new
          @auth = Auth.new(@config)
        end

        # GET request to API endpoint
        #
        # @param path [String] the endpoint path
        # @param params [Hash] query parameters
        # @return [Hash, Array] the response data
        # @raise [APIError] if request fails
        def get(path, **params)
          request(:get, path, params: params)
        end

        # POST request to API endpoint
AuthenticationError class · ruby · L44-L255 (212 LOC)
lib/magi/archive/mcp/client.rb
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config object (creates new one if nil)
        def initialize(config = nil)
          @config = config || Config.new
          @auth = Auth.new(@config)
        end

        # GET request to API endpoint
        #
        # @param path [String] the endpoint path
        # @param params [Hash] query parameters
        # @return [Hash, Array] the response data
        # @raise [APIError] if request fails
        def get(path, **params)
          request(:get, path, params: params)
        end

        # POST request to API endpoint
AuthenticationError class · ruby · L44-L255 (212 LOC)
lib/magi/archive/mcp/client.rb
        class AuthenticationError < APIError; end

        # Authorization error (403 responses)
        class AuthorizationError < APIError; end

        # Not found error (404 responses)
        class NotFoundError < APIError; end

        # Server error (5xx responses)
        class ServerError < APIError; end

        attr_reader :config, :auth

        # Initialize client with optional configuration
        #
        # @param config [Config, nil] optional config object (creates new one if nil)
        def initialize(config = nil)
          @config = config || Config.new
          @auth = Auth.new(@config)
        end

        # GET request to API endpoint
        #
        # @param path [String] the endpoint path
        # @param params [Hash] query parameters
        # @return [Hash, Array] the response data
        # @raise [APIError] if request fails
        def get(path, **params)
          request(:get, path, params: params)
        end

        # POST request to API endpoint
‹ prevpage 3 / 50next ›