You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: basic.rb
    path of file: ./repos/gruf/lib/gruf/interceptors/authentication
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
#
# Permission
    
        def valid?
          server_credentials.any? do |cred|
            username = cred.fetch(:username, '').to_s
            password = cred.fetch(:password, '').to_s
            if username.empty?
              request_password == password
            else
              request_credentials == "#{username}:#{password}"
            end
          end