From 9fab3711d5c2bd839d323c6081da8712cedf0362 Mon Sep 17 00:00:00 2001 From: Bart de Water <496367+bdewater@users.noreply.github.com> Date: Sat, 25 Feb 2023 16:39:57 -0500 Subject: [PATCH] Add signatures for Action Controller content_security_policy and permissions_policy The block for content_security_policy should have bind(T.attached_class) but that's not possible with modules at the moment --- rbi/annotations/actionpack.rbi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/rbi/annotations/actionpack.rbi b/rbi/annotations/actionpack.rbi index c2bba859..6d6dc587 100644 --- a/rbi/annotations/actionpack.rbi +++ b/rbi/annotations/actionpack.rbi @@ -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