Skip to content

Commit

Permalink
Add signatures for Action Controller content_security_policy and perm…
Browse files Browse the repository at this point in the history
…issions_policy

The block for content_security_policy should have bind(T.attached_class) but that's not possible with modules at the moment
  • Loading branch information
bdewater committed Feb 25, 2023
1 parent ada3abc commit 9fab371
Showing 1 changed file with 18 additions and 0 deletions.
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,24 @@ 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::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::Flash::ClassMethods
sig { params(types: Symbol).void }
def add_flash_types(*types); end
Expand Down

0 comments on commit 9fab371

Please sign in to comment.