Moves the existing virtual-thread/context-propagation project into context-propagation/ and adds method-security/ for the Spring Security 7 method-security article: nine runnable demos, fourteen assertions, and every transcript the article quotes, regenerated by scripts/run-all.sh. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RSrsDSRKVsY588yFiMJMo9
25 lines
1.3 KiB
Plaintext
25 lines
1.3 KiB
Plaintext
==============================================================================
|
|
Demo 9 -- #parameterName and the -parameters compiler flag
|
|
==============================================================================
|
|
compiled with -parameters : false
|
|
byParameterName param[0] : arg0
|
|
byParameterAlias param[0] : arg0 (annotated @P("o"))
|
|
SLF4J(W): No SLF4J providers were found.
|
|
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
|
|
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
|
|
|
|
alice calling with her own name
|
|
-------------------------------
|
|
#owner == authentication.name DENIED -> AuthorizationDeniedException: Access Denied
|
|
#o == authentication.name (@P("o")) ALLOWED -> ok
|
|
|
|
alice calling with somebody else's name
|
|
---------------------------------------
|
|
#owner == authentication.name DENIED -> AuthorizationDeniedException: Access Denied
|
|
#o == authentication.name (@P("o")) DENIED -> AuthorizationDeniedException: Access Denied
|
|
|
|
Without -parameters the first expression denies BOTH calls -- it fails
|
|
closed, which is the good direction, but it fails silently in the sense
|
|
that nothing tells you the rule is not the rule you wrote. @P("o") does
|
|
not depend on the flag, because the name is in the class file either way.
|