Skip to content

Commit a0621e5

Browse files
zzakgabriel-amaral
andcommitted
Private methods do not need :nodoc: to be private API
Follow up to rails#51279 Co-authored-by: Gabriel Amaral <[email protected]>
1 parent 213bdfe commit a0621e5

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

actionpack/lib/action_controller/metal/request_forgery_protection.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def handle_unverified_request
265265
end
266266

267267
private
268-
class NullSessionHash < Rack::Session::Abstract::SessionHash # :nodoc:
268+
class NullSessionHash < Rack::Session::Abstract::SessionHash
269269
def initialize(req)
270270
super(nil, req)
271271
@data = {}
@@ -284,7 +284,7 @@ def enabled?
284284
end
285285
end
286286

287-
class NullCookieJar < ActionDispatch::Cookies::CookieJar # :nodoc:
287+
class NullCookieJar < ActionDispatch::Cookies::CookieJar
288288
def write(*)
289289
# nothing
290290
end
@@ -396,7 +396,7 @@ def verify_authenticity_token # :doc:
396396
end
397397
end
398398

399-
def handle_unverified_request # :doc:
399+
def handle_unverified_request
400400
protection_strategy = forgery_protection_strategy.new(self)
401401

402402
if protection_strategy.respond_to?(:warning_message)
@@ -406,15 +406,14 @@ def handle_unverified_request # :doc:
406406
protection_strategy.handle_unverified_request
407407
end
408408

409-
def unverified_request_warning_message # :nodoc:
409+
def unverified_request_warning_message
410410
if valid_request_origin?
411411
"Can't verify CSRF token authenticity."
412412
else
413413
"HTTP Origin header (#{request.origin}) didn't match request.base_url (#{request.base_url})"
414414
end
415415
end
416416

417-
# :nodoc:
418417
CROSS_ORIGIN_JAVASCRIPT_WARNING = "Security warning: an embedded " \
419418
"<script> tag on another site requested protected JavaScript. " \
420419
"If you know what you're doing, go ahead and disable forgery " \
@@ -653,15 +652,15 @@ def normalize_relative_action_path(rel_action_path) # :doc:
653652
uri.path.chomp("/")
654653
end
655654

656-
def generate_csrf_token # :nodoc:
655+
def generate_csrf_token
657656
SecureRandom.urlsafe_base64(AUTHENTICITY_TOKEN_LENGTH)
658657
end
659658

660-
def encode_csrf_token(csrf_token) # :nodoc:
659+
def encode_csrf_token(csrf_token)
661660
Base64.urlsafe_encode64(csrf_token, padding: false)
662661
end
663662

664-
def decode_csrf_token(encoded_csrf_token) # :nodoc:
663+
def decode_csrf_token(encoded_csrf_token)
665664
Base64.urlsafe_decode64(encoded_csrf_token)
666665
end
667666
end

0 commit comments

Comments
 (0)