Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add signatures for Action Controller content_security_policy and permissions_policy #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions rbi/annotations/actionpack.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ class ActionController::API
MODULES = T.let(T.unsafe(nil), T::Array[T.untyped])
end

module ActionController::ContentSecurityPolicy::ClassMethods
sig do
params(
enabled: T.untyped,
options: T.untyped,
block: T.nilable(T.proc.params(policy: ActionDispatch::ContentSecurityPolicy).void)
).void
end
def content_security_policy(enabled = true, **options, &block); end
end

module ActionController::Flash::ClassMethods
sig { params(types: Symbol).void }
def add_flash_types(*types); end
Expand Down Expand Up @@ -210,6 +221,13 @@ class ActionController::Parameters
def values_at(*keys); end
end

module ActionController::PermissionsPolicy::ClassMethods
sig do
params(options: T.untyped, block: T.nilable(T.proc.params(policy: ActionDispatch::PermissionsPolicy).void)).void
end
def permissions_policy(**options, &block); end
end

module ActionController::RequestForgeryProtection
private

Expand Down