← back to Magi-AGI__magi-archive-mcp

Function bodies 2,478 total

All specs Real LLM only Function bodies
Auth class · ruby · L26-L254 (229 LOC)
lib/magi/archive/mcp/auth.rb
      class Auth
        # Authentication error raised when token operations fail
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch f
Auth class · ruby · L26-L254 (229 LOC)
lib/magi/archive/mcp/auth.rb
      class Auth
        # Authentication error raised when token operations fail
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch f
Auth class · ruby · L26-L254 (229 LOC)
lib/magi/archive/mcp/auth.rb
      class Auth
        # Authentication error raised when token operations fail
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch f
Auth class · ruby · L26-L254 (229 LOC)
lib/magi/archive/mcp/auth.rb
      class Auth
        # Authentication error raised when token operations fail
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch f
Auth class · ruby · L26-L254 (229 LOC)
lib/magi/archive/mcp/auth.rb
      class Auth
        # Authentication error raised when token operations fail
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch f
Auth class · ruby · L26-L254 (229 LOC)
lib/magi/archive/mcp/auth.rb
      class Auth
        # Authentication error raised when token operations fail
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch f
Auth class · ruby · L26-L254 (229 LOC)
lib/magi/archive/mcp/auth.rb
      class Auth
        # Authentication error raised when token operations fail
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch f
Methodology: Repobility · https://repobility.com/research/state-of-ai-code-2026/
AuthenticationError class · ruby · L28-L253 (226 LOC)
lib/magi/archive/mcp/auth.rb
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_to
AuthenticationError class · ruby · L28-L253 (226 LOC)
lib/magi/archive/mcp/auth.rb
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_to
AuthenticationError class · ruby · L28-L253 (226 LOC)
lib/magi/archive/mcp/auth.rb
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_to
AuthenticationError class · ruby · L28-L253 (226 LOC)
lib/magi/archive/mcp/auth.rb
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_to
AuthenticationError class · ruby · L28-L253 (226 LOC)
lib/magi/archive/mcp/auth.rb
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_to
AuthenticationError class · ruby · L28-L253 (226 LOC)
lib/magi/archive/mcp/auth.rb
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_to
AuthenticationError class · ruby · L28-L253 (226 LOC)
lib/magi/archive/mcp/auth.rb
        class AuthenticationError < StandardError; end

        # Token verification error
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_to
VerificationError class · ruby · L31-L203 (173 LOC)
lib/magi/archive/mcp/auth.rb
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
Open data scored by Repobility · https://repobility.com
VerificationError class · ruby · L31-L203 (173 LOC)
lib/magi/archive/mcp/auth.rb
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
VerificationError class · ruby · L31-L203 (173 LOC)
lib/magi/archive/mcp/auth.rb
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
VerificationError class · ruby · L31-L203 (173 LOC)
lib/magi/archive/mcp/auth.rb
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
VerificationError class · ruby · L31-L203 (173 LOC)
lib/magi/archive/mcp/auth.rb
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
VerificationError class · ruby · L31-L203 (173 LOC)
lib/magi/archive/mcp/auth.rb
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
VerificationError class · ruby · L31-L203 (173 LOC)
lib/magi/archive/mcp/auth.rb
        class VerificationError < StandardError; end

        # JWKS fetch error
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
JWKSError class · ruby · L34-L101 (68 LOC)
lib/magi/archive/mcp/auth.rb
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
        # @return [Boolean] true if token exists and not expired
        def tok
JWKSError class · ruby · L34-L101 (68 LOC)
lib/magi/archive/mcp/auth.rb
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
        # @return [Boolean] true if token exists and not expired
        def tok
Same scanner, your repo: https://repobility.com — Repobility
JWKSError class · ruby · L34-L101 (68 LOC)
lib/magi/archive/mcp/auth.rb
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
        # @return [Boolean] true if token exists and not expired
        def tok
JWKSError class · ruby · L34-L101 (68 LOC)
lib/magi/archive/mcp/auth.rb
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
        # @return [Boolean] true if token exists and not expired
        def tok
JWKSError class · ruby · L34-L101 (68 LOC)
lib/magi/archive/mcp/auth.rb
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
        # @return [Boolean] true if token exists and not expired
        def tok
JWKSError class · ruby · L34-L101 (68 LOC)
lib/magi/archive/mcp/auth.rb
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
        # @return [Boolean] true if token exists and not expired
        def tok
JWKSError class · ruby · L34-L101 (68 LOC)
lib/magi/archive/mcp/auth.rb
        class JWKSError < StandardError; end

        # Refresh buffer: refresh token this many seconds before expiry
        REFRESH_BUFFER_SECONDS = 300

        attr_reader :config, :username, :resolved_role

        # Initialize auth handler with configuration
        #
        # @param config [Config] the configuration object
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end

        # Get current valid token, fetching new one if needed
        #
        # @return [String] the JWT token
        # @raise [AuthenticationError] if token fetch fails
        def token
          return @token if token_valid?

          fetch_token
          @token
        end

        # Check if current token is still valid
        #
        # @return [Boolean] true if token exists and not expired
        def tok
initialize method · ruby · L44-L52 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end
initialize method · ruby · L44-L52 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end
initialize method · ruby · L44-L52 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end
Repobility — the code-quality scanner for AI-generated software · https://repobility.com
initialize method · ruby · L44-L52 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end
initialize method · ruby · L44-L52 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end
initialize method · ruby · L44-L52 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end
initialize method · ruby · L44-L52 (9 LOC)
lib/magi/archive/mcp/auth.rb
        def initialize(config)
          @config = config
          @token = nil
          @token_expires_at = nil
          @username = nil
          @resolved_role = nil
          @jwks_cache = nil
          @jwks_cached_at = nil
        end
token method · ruby · L58-L63 (6 LOC)
lib/magi/archive/mcp/auth.rb
        def token
          return @token if token_valid?

          fetch_token
          @token
        end
token method · ruby · L58-L63 (6 LOC)
lib/magi/archive/mcp/auth.rb
        def token
          return @token if token_valid?

          fetch_token
          @token
        end
token method · ruby · L58-L63 (6 LOC)
lib/magi/archive/mcp/auth.rb
        def token
          return @token if token_valid?

          fetch_token
          @token
        end
token method · ruby · L58-L63 (6 LOC)
lib/magi/archive/mcp/auth.rb
        def token
          return @token if token_valid?

          fetch_token
          @token
        end
Methodology: Repobility · https://repobility.com/research/state-of-ai-code-2026/
token method · ruby · L58-L63 (6 LOC)
lib/magi/archive/mcp/auth.rb
        def token
          return @token if token_valid?

          fetch_token
          @token
        end
token method · ruby · L58-L63 (6 LOC)
lib/magi/archive/mcp/auth.rb
        def token
          return @token if token_valid?

          fetch_token
          @token
        end
token method · ruby · L58-L63 (6 LOC)
lib/magi/archive/mcp/auth.rb
        def token
          return @token if token_valid?

          fetch_token
          @token
        end
token_valid? method · ruby · L68-L72 (5 LOC)
lib/magi/archive/mcp/auth.rb
        def token_valid?
          return false if @token.nil? || @token_expires_at.nil?

          Time.now < (@token_expires_at - REFRESH_BUFFER_SECONDS)
        end
token_valid? method · ruby · L68-L72 (5 LOC)
lib/magi/archive/mcp/auth.rb
        def token_valid?
          return false if @token.nil? || @token_expires_at.nil?

          Time.now < (@token_expires_at - REFRESH_BUFFER_SECONDS)
        end
token_valid? method · ruby · L68-L72 (5 LOC)
lib/magi/archive/mcp/auth.rb
        def token_valid?
          return false if @token.nil? || @token_expires_at.nil?

          Time.now < (@token_expires_at - REFRESH_BUFFER_SECONDS)
        end
token_valid? method · ruby · L68-L72 (5 LOC)
lib/magi/archive/mcp/auth.rb
        def token_valid?
          return false if @token.nil? || @token_expires_at.nil?

          Time.now < (@token_expires_at - REFRESH_BUFFER_SECONDS)
        end
token_valid? method · ruby · L68-L72 (5 LOC)
lib/magi/archive/mcp/auth.rb
        def token_valid?
          return false if @token.nil? || @token_expires_at.nil?

          Time.now < (@token_expires_at - REFRESH_BUFFER_SECONDS)
        end
Open data scored by Repobility · https://repobility.com
token_valid? method · ruby · L68-L72 (5 LOC)
lib/magi/archive/mcp/auth.rb
        def token_valid?
          return false if @token.nil? || @token_expires_at.nil?

          Time.now < (@token_expires_at - REFRESH_BUFFER_SECONDS)
        end
token_valid? method · ruby · L68-L72 (5 LOC)
lib/magi/archive/mcp/auth.rb
        def token_valid?
          return false if @token.nil? || @token_expires_at.nil?

          Time.now < (@token_expires_at - REFRESH_BUFFER_SECONDS)
        end
fetch_jwks method · ruby · L79-L90 (12 LOC)
lib/magi/archive/mcp/auth.rb
        def fetch_jwks(force: false)
          return @jwks_cache if jwks_cache_valid? && !force

          url = config.url_for("/.well-known/jwks.json")

          http_client = configure_ssl(HTTP)
          response = http_client.get(url)

          unless response.status.success?
            raise JWKSError,
                  "JWKS fetch failed: HTTP #{response.code}"
          end
page 1 / 50next ›