How to use mixin method of Generator.ClassMethods Package

Best Rr_ruby code snippet using Generator.ClassMethods.mixin

doorkeeper.rbi

Source:doorkeeper.rbi Github

copy

Full Screen

1# This file is autogenerated. Do not edit it by hand. Regenerate it with:2# srb rbi sorbet-typed3#4# If you would like to make changes to this file, great! Please upstream any changes you make here:5#6# https://github.com/sorbet/sorbet-typed/edit/master/lib/doorkeeper/>=5/doorkeeper.rbi7#8# typed: ignore9module Doorkeeper10 class << self11 def authenticate(request, methods = T.unsafe(nil)); end12 def config; end13 def configuration; end14 def configure(&block); end15 def setup_application_owner; end16 def setup_orm_adapter; end17 def setup_orm_models; end18 end19end20module Doorkeeper::AccessGrantMixin21 include(::Doorkeeper::OAuth::Helpers)22 include(::Doorkeeper::Models::Expirable)23 include(::Doorkeeper::Models::Revocable)24 include(::Doorkeeper::Models::Accessible)25 include(::Doorkeeper::Models::Scopes)26 extend(::ActiveSupport::Concern)27 include(::Doorkeeper::Models::Orderable)28 include(::Doorkeeper::Models::SecretStorable)29 include(::Doorkeeper::Models::ResourceOwnerable)30 mixes_in_class_methods(::Doorkeeper::AccessGrantMixin::ClassMethods)31 def uses_pkce?; end32end33module Doorkeeper::AccessGrantMixin::ClassMethods34 def by_token(token); end35 def fallback_secret_strategy; end36 def generate_code_challenge(code_verifier); end37 def pkce_supported?; end38 def revoke_all_for(application_id, resource_owner, clock = T.unsafe(nil)); end39 def secret_strategy; end40end41module Doorkeeper::AccessTokenMixin42 include(::Doorkeeper::OAuth::Helpers)43 include(::Doorkeeper::Models::Expirable)44 include(::Doorkeeper::Models::Reusable)45 include(::Doorkeeper::Models::Revocable)46 include(::Doorkeeper::Models::Accessible)47 include(::Doorkeeper::Models::Scopes)48 extend(::ActiveSupport::Concern)49 include(::Doorkeeper::Models::Orderable)50 include(::Doorkeeper::Models::SecretStorable)51 include(::Doorkeeper::Models::ResourceOwnerable)52 mixes_in_class_methods(::Doorkeeper::AccessTokenMixin::ClassMethods)53 def acceptable?(scopes); end54 def as_json(_options = T.unsafe(nil)); end55 def plaintext_refresh_token; end56 def plaintext_token; end57 def revoke_previous_refresh_token!; end58 def same_credential?(access_token); end59 def same_resource_owner?(access_token); end60 def token_type; end61 def use_refresh_token?; end62 private63 def attributes_for_token_generator; end64 def generate_refresh_token; end65 def generate_token; end66 def old_refresh_token; end67 def token_generator; end68end69module Doorkeeper::AccessTokenMixin::ClassMethods70 def authorized_tokens_for(application_id, resource_owner); end71 def by_previous_refresh_token(previous_refresh_token); end72 def by_refresh_token(refresh_token); end73 def by_token(token); end74 def create_for(application:, resource_owner:, scopes:, **token_attributes); end75 def fallback_secret_strategy; end76 def find_access_token_in_batches(relation, *args, &block); end77 def find_matching_token(relation, application, scopes); end78 def find_or_create_for(application:, resource_owner:, scopes:, **token_attributes); end79 def last_authorized_token_for(application_id, resource_owner); end80 def matching_token_for(application, resource_owner, scopes); end81 def revoke_all_for(application_id, resource_owner, clock = T.unsafe(nil)); end82 def scopes_match?(token_scopes, param_scopes, app_scopes); end83 def secret_strategy; end84end85class Doorkeeper::AccessGrant < ::ActiveRecord::Base86 include(::Doorkeeper::Orm::ActiveRecord::Mixins::AccessGrant)87end88class Doorkeeper::AccessToken < ::ActiveRecord::Base89 include(::Doorkeeper::Orm::ActiveRecord::Mixins::AccessToken)90end91class Doorkeeper::Application < ::ActiveRecord::Base92 include(::Doorkeeper::Orm::ActiveRecord::Mixins::Application)93end94class Doorkeeper::ApplicationController < ::ActionController::Base95end96class Doorkeeper::ApplicationsController < ::Doorkeeper::ApplicationController97 def create; end98 def destroy; end99 def edit; end100 def index; end101 def new; end102 def show; end103 def update; end104 private105 def application_params; end106 def i18n_scope(action); end107 def set_application; end108end109class Doorkeeper::ApplicationMetalController < ::ActionController::API110end111module Doorkeeper::ApplicationMixin112 include(::Doorkeeper::OAuth::Helpers)113 include(::Doorkeeper::Models::Scopes)114 extend(::ActiveSupport::Concern)115 include(::Doorkeeper::Models::Orderable)116 include(::Doorkeeper::Models::SecretStorable)117 mixes_in_class_methods(::Doorkeeper::ApplicationMixin::ClassMethods)118 def redirect_uri=(uris); end119 def secret_matches?(input); end120end121module Doorkeeper::ApplicationMixin::ClassMethods122 def by_uid(uid); end123 def by_uid_and_secret(uid, secret); end124 def fallback_secret_strategy; end125 def secret_strategy; end126end127class Doorkeeper::AuthorizationsController < ::Doorkeeper::ApplicationController128 def create; end129 def destroy; end130 def new; end131 private132 def after_successful_authorization(context); end133 def authorization; end134 def authorize_response; end135 def before_successful_authorization(context = nil); end136 def build_context(**attributes); end137 def matching_token?; end138 def pre_auth_param_fields; end139 def pre_auth_params; end140 def pre_auth; end141 def redirect_or_render(auth); end142 def render_error; end143 def render_success; end144 def strategy; end145end146class Doorkeeper::AuthorizedApplicationsController < ::Doorkeeper::ApplicationController147 def destroy; end148 def index; end149end150class Doorkeeper::Config151 extend(::Doorkeeper::Config::Option)152 def access_grant_class(*_args); end153 def access_grant_model; end154 def access_token_class(*_args); end155 def access_token_expires_in(*_args); end156 def access_token_generator(*_args); end157 def access_token_methods; end158 def access_token_model; end159 def active_record_options(*_args); end160 def after_successful_authorization(*_args); end161 def after_successful_strategy_response(*_args); end162 def allow_blank_redirect_uri(*_args); end163 def allow_blank_redirect_uri?(application = T.unsafe(nil)); end164 def allow_grant_flow_for_client(*_args); end165 def allow_grant_flow_for_client?(grant_flow, client); end166 def allow_token_introspection(*_args); end167 def api_only; end168 def application_class(*_args); end169 def application_model; end170 def application_secret_fallback_strategy; end171 def application_secret_hashed?; end172 def application_secret_strategy; end173 def authenticate_admin(*_args); end174 def authenticate_resource_owner(*_args); end175 def authorization_code_expires_in(*_args); end176 def authorization_response_types; end177 def authorize_resource_owner_for_client(*_args); end178 def base_controller(*_args); end179 def base_metal_controller(*_args); end180 def before_successful_authorization(*_args); end181 def before_successful_strategy_response(*_args); end182 def builder_class; end183 def client_credentials_methods; end184 def confirm_application_owner?; end185 def custom_access_token_expires_in(*_args); end186 def custom_introspection_response(*_args); end187 def default_generator_method(*_args); end188 def default_scopes; end189 def enable_application_owner?; end190 def enforce_configured_scopes?; end191 def enforce_content_type; end192 def forbid_redirect_uri(*_args); end193 def force_ssl_in_redirect_uri(*_args); end194 def grant_flows(*_args); end195 def handle_auth_errors(*_args); end196 def native_redirect_uri(*_args); end197 def option_defined?(name); end198 def optional_scopes; end199 def orm(*_args); end200 def polymorphic_resource_owner?; end201 def raise_on_errors?; end202 def realm(*_args); end203 def refresh_token_enabled?; end204 def resolve_controller(name); end205 def resource_owner_from_credentials(*_args); end206 def reuse_access_token; end207 def revoke_previous_client_credentials_token?; end208 def scopes; end209 def scopes_by_grant_type; end210 def skip_authorization(*_args); end211 def token_grant_types; end212 def token_lookup_batch_size(*_args); end213 def token_reuse_limit(*_args); end214 def token_secret_fallback_strategy; end215 def token_secret_strategy; end216 def validate!; end217 private218 def calculate_authorization_response_types; end219 def calculate_token_grant_types; end220 def option_set?(instance_key); end221 def validate_reuse_access_token_value; end222 def validate_secret_strategies; end223 def validate_token_reuse_limit; end224 class << self225 def builder_class; end226 end227end228class Doorkeeper::Config::AbstractBuilder229 def initialize(config = T.unsafe(nil), &block); end230 def build; end231 def config; end232end233class Doorkeeper::Config::Builder < ::Doorkeeper::Config::AbstractBuilder234 def access_grant_class(*args, &block); end235 def access_token_class(*args, &block); end236 def access_token_expires_in(*args, &block); end237 def access_token_generator(*args, &block); end238 def access_token_methods(*methods); end239 def active_record_options(*args, &block); end240 def admin_authenticator(*args, &block); end241 def after_successful_authorization(*args, &block); end242 def after_successful_strategy_response(*args, &block); end243 def allow_blank_redirect_uri(*args, &block); end244 def allow_grant_flow_for_client(*args, &block); end245 def allow_token_introspection(*args, &block); end246 def api_only; end247 def application_class(*args, &block); end248 def authorization_code_expires_in(*args, &block); end249 def authorize_resource_owner_for_client(*args, &block); end250 def base_controller(*args, &block); end251 def base_metal_controller(*args, &block); end252 def before_successful_authorization(*args, &block); end253 def before_successful_strategy_response(*args, &block); end254 def client_credentials(*methods); end255 def confirm_application_owner; end256 def custom_access_token_expires_in(*args, &block); end257 def custom_introspection_response(*args, &block); end258 def default_generator_method(*args, &block); end259 def default_scopes(*scopes); end260 def enable_application_owner(opts = T.unsafe(nil)); end261 def enforce_configured_scopes; end262 def enforce_content_type; end263 def forbid_redirect_uri(*args, &block); end264 def force_ssl_in_redirect_uri(*args, &block); end265 def grant_flows(*args, &block); end266 def handle_auth_errors(*args, &block); end267 def hash_application_secrets(using: T.unsafe(nil), fallback: T.unsafe(nil)); end268 def hash_token_secrets(using: T.unsafe(nil), fallback: T.unsafe(nil)); end269 def native_redirect_uri(*args, &block); end270 def optional_scopes(*scopes); end271 def orm(*args, &block); end272 def realm(*args, &block); end273 def resource_owner_authenticator(*args, &block); end274 def resource_owner_from_credentials(*args, &block); end275 def reuse_access_token; end276 def revoke_previous_client_credentials_token; end277 def scopes_by_grant_type(hash = T.unsafe(nil)); end278 def skip_authorization(*args, &block); end279 def token_lookup_batch_size(*args, &block); end280 def token_reuse_limit(*args, &block); end281 def use_polymorphic_resource_owner; end282 def use_refresh_token(enabled = T.unsafe(nil), &block); end283 private284 def configure_secrets_for(type, using:, fallback:); end285end286module Doorkeeper::Config::Option287 def option(name, options = T.unsafe(nil)); end288 class << self289 def extended(base); end290 end291end292module Doorkeeper::DashboardHelper293 def doorkeeper_errors_for(object, method); end294 def doorkeeper_submit_path(application); end295end296class Doorkeeper::Engine < ::Rails::Engine297end298module Doorkeeper::Errors299end300class Doorkeeper::Errors::BaseResponseError < ::Doorkeeper::Errors::DoorkeeperError301 def initialize(response); end302 def response; end303end304class Doorkeeper::Errors::DoorkeeperError < ::StandardError305 sig { returns(Symbol) }306 def type; end307end308class Doorkeeper::Errors::InvalidGrantReuse < ::Doorkeeper::Errors::DoorkeeperError309 def type; end310end311class Doorkeeper::Errors::InvalidToken < ::Doorkeeper::Errors::BaseResponseError312end313class Doorkeeper::Errors::InvalidTokenStrategy < ::Doorkeeper::Errors::DoorkeeperError314 def type; end315end316class Doorkeeper::Errors::MissingRequiredParameter < ::Doorkeeper::Errors::DoorkeeperError317 def initialize(missing_param); end318 def missing_param; end319 def type; end320end321class Doorkeeper::Errors::NoOrmCleaner < ::Doorkeeper::Errors::DoorkeeperError322end323class Doorkeeper::Errors::TokenExpired < ::Doorkeeper::Errors::InvalidToken324end325class Doorkeeper::Errors::TokenForbidden < ::Doorkeeper::Errors::InvalidToken326end327class Doorkeeper::Errors::TokenGeneratorNotFound < ::Doorkeeper::Errors::DoorkeeperError328end329class Doorkeeper::Errors::TokenRevoked < ::Doorkeeper::Errors::InvalidToken330end331class Doorkeeper::Errors::TokenUnknown < ::Doorkeeper::Errors::InvalidToken332end333class Doorkeeper::Errors::UnableToGenerateToken < ::Doorkeeper::Errors::DoorkeeperError334end335module Doorkeeper::Helpers336end337module Doorkeeper::Helpers::Controller338 private339 def authenticate_admin!; end340 def authenticate_resource_owner!; end341 def config_methods; end342 def current_resource_owner; end343 def doorkeeper_token; end344 def enforce_content_type; end345 def get_error_response_from_exception(exception); end346 def handle_token_exception(exception); end347 def resource_owner_from_credentials; end348 def server; end349 def skip_authorization?; end350 def x_www_form_urlencoded?; end351end352class Doorkeeper::MissingConfiguration < ::StandardError353 def initialize; end354end355class Doorkeeper::MissingConfigurationBuilderClass < ::StandardError356end357module Doorkeeper::Models358end359module Doorkeeper::Models::Accessible360 def accessible?; end361end362module Doorkeeper::Models::Expirable363 def expired?; end364 def expires_at; end365 def expires_in_seconds; end366end367module Doorkeeper::Models::Orderable368 extend(::ActiveSupport::Concern)369 mixes_in_class_methods(::Doorkeeper::Models::Orderable::ClassMethods)370end371module Doorkeeper::Models::Orderable::ClassMethods372 def ordered_by(attribute, direction = T.unsafe(nil)); end373end374module Doorkeeper::Models::ResourceOwnerable375 extend(::ActiveSupport::Concern)376 mixes_in_class_methods(::Doorkeeper::Models::ResourceOwnerable::ClassMethods)377end378module Doorkeeper::Models::ResourceOwnerable::ClassMethods379 def by_resource_owner(resource_owner); end380 protected381 def resource_owner_id_for(resource_owner); end382end383module Doorkeeper::Models::Reusable384 def reusable?; end385end386module Doorkeeper::Models::Revocable387 def revoke(clock = T.unsafe(nil)); end388 def revoked?; end389end390module Doorkeeper::Models::Scopes391 def includes_scope?(*required_scopes); end392 def scopes; end393 def scopes=(value); end394 def scopes_string; end395end396module Doorkeeper::Models::SecretStorable397 extend(::ActiveSupport::Concern)398 mixes_in_class_methods(::Doorkeeper::Models::SecretStorable::ClassMethods)399 def fallback_secret_strategy(*_, &_); end400 def secret_strategy(*_, &_); end401end402module Doorkeeper::Models::SecretStorable::ClassMethods403 def fallback_secret_strategy; end404 def find_by_fallback_token(attr, plain_secret); end405 def find_by_plaintext_token(attr, token); end406 def secret_matches?(*_, &_); end407 def secret_strategy; end408 def upgrade_fallback_value(instance, attr, plain_secret); end409end410module Doorkeeper::OAuth411end412Doorkeeper::OAuth::AUTHORIZATION_CODE = T.let(T.unsafe(nil), String)413module Doorkeeper::OAuth::Authorization414end415class Doorkeeper::OAuth::Authorization::Code416 def initialize(pre_auth, resource_owner); end417 def issue_token!; end418 def oob_redirect; end419 def pre_auth; end420 def resource_owner; end421 def token; end422 private423 def access_grant_attributes; end424 def authorization_code_expires_in; end425 def pkce_attributes; end426 def pkce_supported?; end427end428class Doorkeeper::OAuth::Authorization::Token429 def initialize(pre_auth, resource_owner); end430 def issue_token!; end431 def oob_redirect; end432 def pre_auth; end433 def resource_owner; end434 def token; end435 private436 def controller; end437 class << self438 def access_token_expires_in(configuration, context); end439 def build_context(pre_auth_or_oauth_client, grant_type, scopes); end440 def refresh_token_enabled?(server, context); end441 end442end443class Doorkeeper::OAuth::Authorization::URIBuilder444 class << self445 def uri_with_fragment(url, parameters = T.unsafe(nil)); end446 def uri_with_query(url, parameters = T.unsafe(nil)); end447 private448 def build_query(parameters = T.unsafe(nil)); end449 end450end451class Doorkeeper::OAuth::AuthorizationCodeRequest < ::Doorkeeper::OAuth::BaseRequest452 def initialize(server, grant, client, parameters = T.unsafe(nil)); end453 def access_token; end454 def client; end455 def code_verifier; end456 def grant; end457 def invalid_request_reason; end458 def missing_param; end459 def redirect_uri; end460 private461 def before_successful_response; end462 def generate_code_challenge(code_verifier); end463 def pkce_supported?; end464 def validate_client; end465 def validate_code_verifier; end466 def validate_grant; end467 def validate_params; end468 def validate_pkce_support; end469 def validate_redirect_uri; end470end471class Doorkeeper::OAuth::BaseRequest472 include(::Doorkeeper::Validations)473 extend(::Doorkeeper::Validations::ClassMethods)474 def after_successful_response; end475 def authorize; end476 def before_successful_response; end477 def default_scopes(*_, &_); end478 def find_or_create_access_token(client, resource_owner, scopes, server); end479 def grant_type; end480 def scopes; end481 def server; end482 def server_config; end483 private484 def build_scopes; end485end486class Doorkeeper::OAuth::BaseResponse487 sig { returns(T::Hash[T.untyped, T.untyped]) }488 def body; end489 sig { returns(String) }490 def description; end491 sig { returns(T::Hash[T.untyped, T.untyped]) }492 def headers; end493 sig { returns(String) }494 def redirect_uri; end495 sig { returns(T::Boolean) }496 def redirectable?; end497 sig { returns(Symbol) }498 def status; end499end500Doorkeeper::OAuth::CLIENT_CREDENTIALS = T.let(T.unsafe(nil), String)501class Doorkeeper::OAuth::Client502 def initialize(application); end503 def application; end504 def id(*_, &_); end505 def name(*_, &_); end506 def redirect_uri(*_, &_); end507 def scopes(*_, &_); end508 def uid(*_, &_); end509 class << self510 def authenticate(credentials, method = T.unsafe(nil)); end511 def find(uid, method = T.unsafe(nil)); end512 end513end514class Doorkeeper::OAuth::Client::Credentials < ::Struct515 def blank?(*_, &_); end516 def secret; end517 def secret=(_); end518 def uid; end519 def uid=(_); end520 class << self521 def [](*_); end522 def from_basic(request); end523 def from_params(request); end524 def from_request(request, *credentials_methods); end525 def inspect; end526 def members; end527 def new(*_); end528 end529end530module Doorkeeper::OAuth::ClientCredentials531end532class Doorkeeper::OAuth::ClientCredentials::Creator533 def call(client, scopes, attributes = T.unsafe(nil)); end534 private535 def find_existing_token_for(client, scopes); end536 def lookup_existing_token?; end537 def server_config; end538 def with_revocation(existing_token:); end539end540class Doorkeeper::OAuth::ClientCredentials::Issuer541 def initialize(server, validator); end542 def create(client, scopes, creator = T.unsafe(nil)); end543 def error; end544 def token; end545 def validator; end546 private547 def create_token(client, scopes, creator); end548end549class Doorkeeper::OAuth::ClientCredentials::Validator550 include(::Doorkeeper::Validations)551 include(::Doorkeeper::OAuth::Helpers)552 extend(::Doorkeeper::Validations::ClassMethods)553 def initialize(server, request); end554 private555 def validate_client; end556 def validate_client_supports_grant_flow; end557 def validate_scopes; end558end559class Doorkeeper::OAuth::ClientCredentialsRequest < ::Doorkeeper::OAuth::BaseRequest560 def initialize(server, client, parameters = T.unsafe(nil)); end561 def access_token; end562 def client; end563 def error(*_, &_); end564 def error_response; end565 def issuer; end566 def original_scopes; end567 def response; end568 private569 def valid?; end570end571class Doorkeeper::OAuth::CodeRequest572 def initialize(pre_auth, resource_owner); end573 def authorize; end574 def deny; end575 def pre_auth; end576 def resource_owner; end577end578class Doorkeeper::OAuth::CodeResponse < ::Doorkeeper::OAuth::BaseResponse579 include(::Doorkeeper::OAuth::Helpers)580 def initialize(pre_auth, auth, options = T.unsafe(nil)); end581 def auth; end582 def issued_token; end583 def pre_auth; end584 def redirect_uri; end585 def redirectable?; end586 def response_on_fragment; end587end588class Doorkeeper::OAuth::Error < ::Struct589 def description; end590 def name; end591 def name=(_); end592 def state; end593 def state=(_); end594 class << self595 def [](*_); end596 def inspect; end597 def members; end598 def new(*_); end599 end600end601class Doorkeeper::OAuth::ErrorResponse < ::Doorkeeper::OAuth::BaseResponse602 include(::Doorkeeper::OAuth::Helpers)603 def initialize(attributes = T.unsafe(nil)); end604 def body; end605 def description(*_, &_); end606 def headers; end607 def name(*_, &_); end608 def raise_exception!; end609 def redirect_uri; end610 def redirectable?; end611 def state(*_, &_); end612 def status; end613 protected614 def exception_class; end615 def realm; end616 private617 def authenticate_info; end618 class << self619 def from_request(request, attributes = T.unsafe(nil)); end620 end621end622class Doorkeeper::OAuth::ForbiddenTokenResponse < ::Doorkeeper::OAuth::ErrorResponse623 def initialize(attributes = T.unsafe(nil)); end624 def description; end625 def headers; end626 def status; end627 protected628 def exception_class; end629 class << self630 def from_scopes(scopes, attributes = T.unsafe(nil)); end631 end632end633Doorkeeper::OAuth::GRANT_TYPES = T.let(T.unsafe(nil), Array)634module Doorkeeper::OAuth::Helpers635end636module Doorkeeper::OAuth::Helpers::ScopeChecker637 class << self638 def valid?(scope_str:, server_scopes:, app_scopes: T.unsafe(nil), grant_type: T.unsafe(nil)); end639 end640end641class Doorkeeper::OAuth::Helpers::ScopeChecker::Validator642 def initialize(scope_str, server_scopes, app_scopes, grant_type); end643 def parsed_scopes; end644 def scope_str; end645 def valid?; end646 private647 def permitted_to_grant_type?; end648 def valid_scopes(server_scopes, app_scopes); end649end650module Doorkeeper::OAuth::Helpers::URIChecker651 class << self652 def as_uri(url); end653 def hypertext_scheme?(uri); end654 def iff_host?(uri); end655 def loopback_uri?(uri); end656 def matches?(url, client_url); end657 def oob_uri?(uri); end658 def query_matches?(query, client_query); end659 def valid?(url); end660 def valid_for_authorization?(url, client_url); end661 def valid_scheme?(uri); end662 end663end664module Doorkeeper::OAuth::Helpers::UniqueToken665 class << self666 def default_generator_method; end667 def generate(options = T.unsafe(nil)); end668 end669end670module Doorkeeper::OAuth::Hooks671end672class Doorkeeper::OAuth::Hooks::Context673 def initialize(**attributes); end674 def auth; end675 def issued_token; end676 def pre_auth; end677end678Doorkeeper::OAuth::IMPLICIT = T.let(T.unsafe(nil), String)679class Doorkeeper::OAuth::InvalidRequestResponse < ::Doorkeeper::OAuth::ErrorResponse680 def initialize(attributes = T.unsafe(nil)); end681 def description; end682 def reason; end683 def redirectable?; end684 def status; end685 class << self686 def from_request(request, attributes = T.unsafe(nil)); end687 end688end689class Doorkeeper::OAuth::InvalidTokenResponse < ::Doorkeeper::OAuth::ErrorResponse690 def initialize(attributes = T.unsafe(nil)); end691 def description; end692 def reason; end693 def status; end694 protected695 def exception_class; end696 private697 def errors_mapping; end698 class << self699 def from_access_token(access_token, attributes = T.unsafe(nil)); end700 end701end702class Doorkeeper::OAuth::NonStandard703end704Doorkeeper::OAuth::NonStandard::IETF_WG_OAUTH2_OOB = T.let(T.unsafe(nil), String)705Doorkeeper::OAuth::NonStandard::IETF_WG_OAUTH2_OOB_AUTO = T.let(T.unsafe(nil), String)706Doorkeeper::OAuth::NonStandard::IETF_WG_OAUTH2_OOB_METHODS = T.let(T.unsafe(nil), Array)707Doorkeeper::OAuth::PASSWORD = T.let(T.unsafe(nil), String)708class Doorkeeper::OAuth::PasswordAccessTokenRequest < ::Doorkeeper::OAuth::BaseRequest709 include(::Doorkeeper::OAuth::Helpers)710 def initialize(server, client, resource_owner, parameters = T.unsafe(nil)); end711 def access_token; end712 def client; end713 def parameters; end714 def resource_owner; end715 private716 def before_successful_response; end717 def validate_client; end718 def validate_client_supports_grant_flow; end719 def validate_resource_owner; end720 def validate_scopes; end721end722class Doorkeeper::OAuth::PreAuthorization723 include(::Doorkeeper::Validations)724 extend(::Doorkeeper::Validations::ClassMethods)725 def initialize(server, parameters = T.unsafe(nil), resource_owner = T.unsafe(nil)); end726 def as_json(_options = T.unsafe(nil)); end727 def authorizable?; end728 def client; end729 def code_challenge; end730 def code_challenge_method; end731 def error_response; end732 def missing_param; end733 def redirect_uri; end734 def resource_owner; end735 def response_type; end736 def scope; end737 def scopes; end738 def state; end739 private740 def build_scopes; end741 def client_id; end742 def grant_type; end743 def pre_auth_hash; end744 def response_on_fragment?; end745 def server; end746 def validate_client; end747 def validate_client_id; end748 def validate_client_supports_grant_flow; end749 def validate_code_challenge_method; end750 def validate_params; end751 def validate_redirect_uri; end752 def validate_resource_owner_authorize_for_client; end753 def validate_response_type; end754 def validate_scopes; end755end756Doorkeeper::OAuth::REFRESH_TOKEN = T.let(T.unsafe(nil), String)757class Doorkeeper::OAuth::RefreshTokenRequest < ::Doorkeeper::OAuth::BaseRequest758 include(::Doorkeeper::OAuth::Helpers)759 def initialize(server, refresh_token, credentials, parameters = T.unsafe(nil)); end760 def access_token; end761 def client; end762 def credentials; end763 def missing_param; end764 def refresh_token; end765 private766 def before_successful_response; end767 def create_access_token; end768 def default_scopes; end769 def load_client(credentials); end770 def refresh_token_revoked_on_use?; end771 def validate_client; end772 def validate_client_match; end773 def validate_scope; end774 def validate_token; end775 def validate_token_presence; end776end777class Doorkeeper::OAuth::Scopes778 include(::Enumerable)779 include(::Comparable)780 def initialize; end781 def &(other); end782 def +(other); end783 def <=>(other); end784 def add(*scopes); end785 def all; end786 def each(*_, &_); end787 def empty?(*_, &_); end788 def exists?(scope); end789 def has_scopes?(scopes); end790 def scopes?(scopes); end791 def to_s; end792 private793 def to_array(other); end794 class << self795 def from_array(array); end796 def from_string(string); end797 end798end799class Doorkeeper::OAuth::Token800 class << self801 def authenticate(request, *methods); end802 def from_access_token_param(request); end803 def from_basic_authorization(request); end804 def from_bearer_authorization(request); end805 def from_bearer_param(request); end806 def from_request(request, *methods); end807 private808 def decode_basic_credentials_token(encoded_header); end809 def match?(header, pattern); end810 def token_from_basic_header(header, pattern); end811 def token_from_header(header, pattern); end812 end813end814class Doorkeeper::OAuth::TokenIntrospection815 def initialize(server, token); end816 def authorized?; end817 def error_response; end818 def to_json(*_); end819 private820 def active?; end821 def authorize!; end822 def authorized_client; end823 def authorized_token; end824 def authorized_token_matches_introspected?; end825 def customize_response(response); end826 def error; end827 def failure_response; end828 def invalid_request_reason; end829 def server; end830 def success_response; end831 def token; end832 def token_introspection_allowed?(auth_client: T.unsafe(nil), auth_token: T.unsafe(nil)); end833 def valid_authorized_token?; end834 def valid_token?; end835end836class Doorkeeper::OAuth::TokenRequest837 def initialize(pre_auth, resource_owner); end838 def authorize; end839 def deny; end840 def pre_auth; end841 def resource_owner; end842end843class Doorkeeper::OAuth::TokenResponse844 def initialize(token); end845 def body; end846 def headers; end847 def status; end848 def token; end849end850module Doorkeeper::Orm851end852module Doorkeeper::Orm::ActiveRecord853 class << self854 def initialize_application_owner!; end855 def initialize_models!; end856 def lazy_load(&block); end857 def models; end858 end859end860module Doorkeeper::Orm::ActiveRecord::Mixins::AccessGrant861 include(::Doorkeeper::AccessGrantMixin)862 def generate_token; end863 def plaintext_token; end864end865module Doorkeeper::Orm::ActiveRecord::Mixins::AccessToken866 include(::Doorkeeper::AccessTokenMixin)867 mixes_in_class_methods(::Doorkeeper::Orm::ActiveRecord::Mixins::AccessToken::ClassMethods)868end869module Doorkeeper::Orm::ActiveRecord::Mixins::AccessToken::ClassMethods870 def active_for(resource_owner); end871 def refresh_token_revoked_on_use?; end872end873module Doorkeeper::Orm::ActiveRecord::Mixins::Application874 include(::Doorkeeper::ApplicationMixin)875 mixes_in_class_methods(::Doorkeeper::Orm::ActiveRecord::Mixins::Application::ClassMethods)876 def plaintext_secret; end877 def read_attribute_for_serialization(key); end878 def renew_secret; end879 private880 def enforce_scopes?; end881 def extract_serializable_attributes(options = {}); end882 def generate_secret; end883 def generate_uid; end884 def scopes_match_configured; end885 def serializable_attributes; end886end887module Doorkeeper::Orm::ActiveRecord::Mixins::Application::ClassMethods888 def authorized_for(resource_owner); end889end890module Doorkeeper::Rails891end892module Doorkeeper::Rails::Helpers893 def doorkeeper_authorize!(*scopes); end894 def doorkeeper_forbidden_render_options(**_); end895 def doorkeeper_unauthorized_render_options(**_); end896 def valid_doorkeeper_token?; end897 private898 def doorkeeper_error; end899 def doorkeeper_invalid_token_response?; end900 def doorkeeper_render_error; end901 def doorkeeper_render_error_with(error); end902 def doorkeeper_render_options(error); end903 def doorkeeper_status_for_error(error, respond_not_found_when_forbidden); end904 def doorkeeper_token; end905end906class Doorkeeper::Rails::Routes907 include(::Doorkeeper::Rails::AbstractRouter)908 extend(::Doorkeeper::Rails::Routes::Registry)909 def initialize(routes, mapper = T.unsafe(nil), &block); end910 def generate_routes!(options); end911 def mapping; end912 private913 def application_routes(mapping); end914 def authorization_routes(mapping); end915 def authorized_applications_routes(mapping); end916 def introspect_routes(mapping); end917 def revoke_routes(mapping); end918 def token_info_routes(mapping); end919 def token_routes(mapping); end920 class << self921 def install!; end922 def mapping; end923 end924end925module Doorkeeper::Rails::Routes::Helper926 def use_doorkeeper(options = T.unsafe(nil), &block); end927end928class Doorkeeper::Rails::Routes::Mapper929 def initialize(mapping = T.unsafe(nil)); end930 def as(alias_names = T.unsafe(nil)); end931 def controllers(controller_names = T.unsafe(nil)); end932 def map(&block); end933 def skip_controllers(*controller_names); end934end935class Doorkeeper::Rails::Routes::Mapping936 def initialize; end937 def [](routes); end938 def as; end939 def as=(_); end940 def controllers; end941 def controllers=(_); end942 def skipped?(controller); end943 def skips; end944 def skips=(_); end945end946module Doorkeeper::Rails::Routes::Registry947 def register(routes); end948 def register_routes(routes); end949 def registered_routes; end950end951class Doorkeeper::Rails::Routes::Registry::InvalidRouterClass < ::StandardError952end953Doorkeeper::Rails::Routes::Registry::ROUTES_ACCESS_LOCK = T.let(T.unsafe(nil), Thread::Mutex)954Doorkeeper::Rails::Routes::Registry::ROUTES_DEFINITION_LOCK = T.let(T.unsafe(nil), Thread::Mutex)955module Doorkeeper::Rake956 class << self957 def load_tasks; end958 end959end960module Doorkeeper::Request961 class << self962 def authorization_strategy(response_type); end963 def get_strategy(grant_type, available); end964 def token_strategy(grant_type); end965 private966 def build_strategy_class(grant_or_request_type); end967 def token_grant_types; end968 end969end970class Doorkeeper::Request::AuthorizationCode < ::Doorkeeper::Request::Strategy971 def client(*_, &_); end972 def parameters(*_, &_); end973 def request; end974 private975 def grant; end976end977class Doorkeeper::Request::ClientCredentials < ::Doorkeeper::Request::Strategy978 def client(*_, &_); end979 def parameters(*_, &_); end980 def request; end981end982class Doorkeeper::Request::Code < ::Doorkeeper::Request::Strategy983 def current_resource_owner(*_, &_); end984 def pre_auth; end985 def request; end986end987class Doorkeeper::Request::Password < ::Doorkeeper::Request::Strategy988 def client(*_, &_); end989 def credentials(*_, &_); end990 def parameters(*_, &_); end991 def request; end992 def resource_owner(*_, &_); end993end994class Doorkeeper::Request::RefreshToken < ::Doorkeeper::Request::Strategy995 def credentials(*_, &_); end996 def parameters(*_, &_); end997 def refresh_token; end998 def request; end999end1000class Doorkeeper::Request::Strategy1001 def initialize(server); end1002 def authorize(*_, &_); end1003 def request; end1004 def server; end1005end1006class Doorkeeper::Request::Token < ::Doorkeeper::Request::Strategy1007 def current_resource_owner(*_, &_); end1008 def pre_auth; end1009 def request; end1010end1011module Doorkeeper::SecretStoring1012end1013class Doorkeeper::SecretStoring::BCrypt < ::Doorkeeper::SecretStoring::Base1014 class << self1015 def allows_restoring_secrets?; end1016 def bcrypt_present?; end1017 def secret_matches?(input, stored); end1018 def transform_secret(plain_secret); end1019 def validate_for(model); end1020 end1021end1022class Doorkeeper::SecretStoring::Base1023 class << self1024 def allows_restoring_secrets?; end1025 def restore_secret(_resource, _attribute); end1026 def secret_matches?(input, stored); end1027 def store_secret(resource, attribute, plain_secret); end1028 def transform_secret(_plain_secret); end1029 def validate_for(model); end1030 end1031end1032class Doorkeeper::SecretStoring::Plain < ::Doorkeeper::SecretStoring::Base1033 class << self1034 def allows_restoring_secrets?; end1035 def restore_secret(resource, attribute); end1036 def transform_secret(plain_secret); end1037 end1038end1039class Doorkeeper::SecretStoring::Sha256Hash < ::Doorkeeper::SecretStoring::Base1040 class << self1041 def allows_restoring_secrets?; end1042 def transform_secret(plain_secret); end1043 end1044end1045class Doorkeeper::Server1046 def initialize(context); end1047 def authorization_request(strategy); end1048 def client; end1049 def context; end1050 def credentials; end1051 def current_resource_owner; end1052 def parameters; end1053 def resource_owner; end1054 def token_request(strategy); end1055end1056class Doorkeeper::StaleRecordsCleaner1057 class << self1058 def configured_orm; end1059 def for(base_scope); end1060 def new(base_scope); end1061 end1062end1063Doorkeeper::StaleRecordsCleaner::CLEANER_CLASS = T.let(T.unsafe(nil), String)1064class Doorkeeper::TokenInfoController < ::Doorkeeper::ApplicationMetalController1065 def show; end1066end1067class Doorkeeper::TokensController < ::Doorkeeper::ApplicationMetalController1068 def create; end1069 def introspect; end1070 def revoke; end1071 private1072 def after_successful_authorization(context); end1073 def authorize_response; end1074 def authorized?; end1075 def before_successful_authorization(context = nil); end1076 def build_context(**attributes); end1077 def revocation_error_response; end1078 def revoke_token; end1079 def strategy; end1080 def token; end1081end1082module Doorkeeper::VERSION1083end1084Doorkeeper::VERSION::MAJOR = T.let(T.unsafe(nil), Integer)1085Doorkeeper::VERSION::MINOR = T.let(T.unsafe(nil), Integer)1086Doorkeeper::VERSION::STRING = T.let(T.unsafe(nil), String)1087Doorkeeper::VERSION::TINY = T.let(T.unsafe(nil), Integer)1088module Doorkeeper::Validations1089 extend(::ActiveSupport::Concern)1090 mixes_in_class_methods(::Doorkeeper::Validations::ClassMethods)1091 def error; end1092 def error=(_); end1093 def valid?; end1094 def validate; end1095end1096module Doorkeeper::Validations::ClassMethods1097 def validate(attribute, options = T.unsafe(nil)); end1098 def validations; end1099end1100module Doorkeeper::IPAddrLoopback1101 def loopback?; end1102end1103module Doorkeeper::Rails::AbstractRouter1104 extend(::ActiveSupport::Concern)1105 def initialize(routes, mapper = T.unsafe(nil), &block); end1106 def generate_routes!(**_options); end1107 def routes; end1108 private1109 def map_route(name, method); end1110end...

Full Screen

Full Screen

mixin.rb

Source:mixin.rb Github

copy

Full Screen

1module Waves2 3 module Resources4 5 StatusCodes = {6 Waves::Dispatchers::NotFoundError => 4047 }8 9 10 module Mixin11 12 attr_reader :request13 14 module ClassMethods15 16 def paths17 unless @paths18 resource = self19 @paths = Class.new( superclass.respond_to?( :paths ) ? superclass.paths : Waves::Resources::Paths ) do20 @resource = resource21 def self.resource ; @resource ; end22 end23 else24 @paths25 end26 end27 def with( options ) ; @options = options ; yield ; @options = nil ; end28 def on( method, path = true, options = nil, &block )29 if path.is_a? Hash30 generator = path.keys.first31 path = path.values.first32 end33 if options34 options[ :path ] = path35 else36 options = { :path => path }37 end38 options = @options.merge( options ) if @options39 matcher = Waves::Matchers::Resource.new( options )40 methods = case method41 when nil then nil42 when true then [ :post, :get, :put, :delete ]43 when Array then method44 else [ method ]45 end46 methods.each do | method |47 functor_with_self( method, matcher, &block )48 end49 paths.module_eval { 50 define_method( generator ) { | *args | generate( path, args ) }51 } if generator52 end53 def before( path = nil, options = {}, &block )54 on( :before, path, options, &block )55 end56 def after( path = nil, options = {}, &block )57 on( :after, path, options, &block )58 end59 def wrap( path = nil, options = {}, &block )60 before( path, options, &block )61 after( path, options, &block )62 end63 def handler( exception, &block ) ; functor( :handler, exception, &block ) ; end64 def always( &block ) ; define_method( :always, &block ) ; end65 66 end67 # this is necessary because you can't define functors within a module because the functor attempts68 # to incorporate the superclass functor table into it's own69 def self.included( resource )70 71 resource.module_eval do 72 73 include ResponseMixin, Functor::Method ; extend ClassMethods74 def initialize( request ); @request = request ; end75 76 def process77 begin78 before ; body = send( request.method ) ; after79 rescue Waves::Dispatchers::Redirect => e80 raise e81 rescue Exception => e82 response.status = ( StatusCodes[ e.class ] || 500 )83 ( body = handler( e ) ) rescue raise e84 Waves::Logger.warn "Handled #{e.class}: #{e}"85 e.backtrace.each { |t| Waves::Logger.debug " #{t}" }86 ensure87 always88 end89 return body90 end91 92 def to( resource )93 resource = case resource94 when Base95 resource96 when Symbol, String97 begin 98 Waves.main::Resources[ resource ]99 rescue NameError => e100 Waves::Logger.debug e.to_s101 e.backtrace.each { |t| Waves::Logger.debug " #{t}" }102 raise Waves::Dispatchers::NotFoundError103 end104 Waves.main::Resources[ resource ]105 end106 r = traits.waves.resource = resource.new( request )107 r.process108 end109 110 def redirect( path ) ; request.redirect( path ) ; end111 112 # override for resources that may have long-running requests. this helps servers 113 # determine how to handle the request114 def deferred? ; false ; end115 116 before {} ; after {} ; always {}117 # handler( Waves::Dispatchers::Redirect ) { |e| raise e }118 119 %w( post get put delete head ).each do | method |120 on( method ) { not_found }121 end122 123 end124 125 end126 end127 128 class Base ; include Mixin ; end 129 end130end...

Full Screen

Full Screen

debug.rb

Source:debug.rb Github

copy

Full Screen

1require 'set' unless defined?(Set)2# This module contains various debugging methods3module SE4 module Debug5 # these modules include or extend themselves and cause problems6 # TODO: Detect it in-place and don't recurse7 RECURSIVE_MODULES = [8 defined?(ActiveSupport::CoreExtensions::Module) && ActiveSupport::CoreExtensions::Module,9 defined?(ActiveSupport::Dependencies::ClassConstMissing) && ActiveSupport::Dependencies::ClassConstMissing,10 defined?(ActiveSupport::Dependencies::Loadable) && ActiveSupport::Dependencies::Loadable,11 defined?(ActiveSupport::Dependencies::ModuleConstMissing) && ActiveSupport::Dependencies::ModuleConstMissing,12 defined?(ActiveSupport::Deprecation::ClassMethods) && ActiveSupport::Deprecation::ClassMethods,13 defined?(Base64) && Base64,14 defined?(Base64::Deprecated) && Base64::Deprecated,15 defined?(ERB::Util) && ERB::Util,16 defined?(JSON::Ext::Generator::GeneratorMethods::Object) && JSON::Ext::Generator::GeneratorMethods::Object,17 defined?(Kernel) && Kernel,18 defined?(MethodCache) && MethodCache,19 defined?(Mocha::ClassMethods) && Mocha::ClassMethods,20 defined?(Mocha::ModuleMethods) && Mocha::ModuleMethods,21 defined?(Mocha::ObjectMethods) && Mocha::ObjectMethods,22 defined?(PP::ObjectMixin) && PP::ObjectMixin,23 ].compact24 # Return class hierarchy as a String.25 #26 # examples:27 # SE::Debug.class_hierarchy(RuntimeError)28 # #=> RuntimeError29 # #=> includes:30 # #=> Kernel31 # #=> extends:32 # #=> Kernel33 # #=> superclass: StandardError34 # #=> includes:35 # #=> Kernel36 # #=> extends:37 # #=> Kernel38 # #=> superclass: Exception39 # #=> includes:40 # #=> Kernel41 # #=> extends:42 # #=> Kernel43 #44 # call-seq:45 # Debug.class_hierarchy(object) => String46 #47 def self.class_hierarchy(klass, opts={})48 return nil if klass.nil?49 opts[:indent] ||= 050 opts[:limit] ||= 1051 return '<truncated>' if opts[:indent] > opts[:limit]52 return nil if opts[:omit_recursives] && RECURSIVE_MODULES.include?(klass)53 opts[:seen] ||= Set.new(RECURSIVE_MODULES)54 buf = [ klass ]55 unless opts[:seen].include?(klass)56 opts[:seen] << (klass = klass.is_a?(Class) ? klass : klass.class)57 indent = ' ' * (opts[:indent] + 1)58 #59 # Included Modules60 #61 includes = []62 klass.included_modules.each do |ii|63 next if ii == klass64 next unless child = class_hierarchy(ii, opts.merge(:indent => indent.size + 1))65 includes << indent + ' ' + child66 end67 if ! includes.empty?68 buf << indent + 'includes:'69 buf += includes70 end71 #72 # Extended Modules73 #74 includes.clear75 (class << klass; self; end).included_modules.each do |ii|76 next if ii == klass77 next unless child = class_hierarchy(ii, opts.merge(:indent => indent.size + 1))78 includes << indent + ' ' + child79 end80 if ! includes.empty?81 buf << indent + 'extends:'82 buf += includes83 end84 # superclass85 if Object != klass.superclass && (child = class_hierarchy(klass.superclass, opts.merge(:indent => indent.size)))86 buf << indent + 'superclass: ' + child87 end88 end89 buf.compact.join("\n")90 end91 end # module Debug92end # module SE93# vim: sw=2 ts=2 et ai nowrap bg=dark...

Full Screen

Full Screen

mixin

Using AI Code Generation

copy

Full Screen

1 def generate(klass, *args)2 klass.new(*args).generate3 def self.included(base)4 base.extend(ClassMethods)5 def initialize(range)6 rand(@range)7 def initialize(range)8 (rand(@range) + 65).chr9puts RandomNumberGenerator.generate(100)10puts LetterGenerator.generate(26)11 def generate(klass, *args)12 klass.new(*args).generate13 def self.included(base)14 base.extend(ClassMethods)15 def initialize(range)16 rand(@range)17 def initialize(range)18 (rand(@range) + 65).chr19puts RandomNumberGenerator.generate(300)20puts LetterGenerator.generate(26)21 def generate(klass, *args)22 klass.new(*args).generate

Full Screen

Full Screen

mixin

Using AI Code Generation

copy

Full Screen

1 def generate(*methods)2 define_method(method) do3 def self.extended(base)4 base.extend(ClassMethods)5obj.extend(Generator)6 def generate(*methods)7 define_method(method) do8 def self.extended(base)9 base.extend(ClassMethods)

Full Screen

Full Screen

mixin

Using AI Code Generation

copy

Full Screen

1 def generate(klass, *args)2 klass.new(*args).generate3 def self.included(base)4 base.extend(ClassMethods)5 def initialize(range)6 rand(@range)7 def initialize(range)8 (rand(@range) + 65).chr9puts RandomNumberGenerator.generate(100)10puts LetterGenerator.generate(26)11 def generate(klass, *args)12 klass.new(*args).generate13 def self.included(base)14 base.extend(ClassMethods)15 def initialize(range)16 rand(@range)17 def initialize(range)18 (rand(@range) + 65).chr19puts RandomNumberGenerator.generate(100)20puts LetterGenerator.generate(26)21 def generate(klass, *args)22 klass.new(*args).generate

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Rr_ruby automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful