You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by lp...@apache.org on 2023/03/29 03:40:13 UTC

[shiro-site] branch asf-site updated: updated jakarta ee principal injection docs

This is an automated email from the ASF dual-hosted git repository.

lprimak pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/shiro-site.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 077c7abd2 updated jakarta ee principal injection docs
077c7abd2 is described below

commit 077c7abd23337ff749723a7994a3cff342e8c80d
Author: lprimak <le...@flowlogix.com>
AuthorDate: Tue Mar 28 22:39:43 2023 -0500

    updated jakarta ee principal injection docs
---
 .well-known/security.txt | 2 +-
 feed.xml                 | 2 +-
 jakarta-ee.html          | 9 ++++-----
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/.well-known/security.txt b/.well-known/security.txt
index c6d9ed9c5..6397428a3 100644
--- a/.well-known/security.txt
+++ b/.well-known/security.txt
@@ -1,5 +1,5 @@
 Contact: mailto:security@shiro.apache.org
-Expires: 2024-02-29T02:39:05Z
+Expires: 2024-03-28T03:38:42Z
 Preferred-Languages: en
 Canonical: https://shiro.apache.org/.well-known/security.txt
 Policy: https://shiro.apache.org/security-reports.html
\ No newline at end of file
diff --git a/feed.xml b/feed.xml
index 061ed2713..08f7ffc3f 100644
--- a/feed.xml
+++ b/feed.xml
@@ -4,7 +4,7 @@
   <subtitle>Simple. Java. Security.</subtitle>
   <link href="https://shiro.apache.org/"/>
   <link rel="self" href="https://shiro.apache.org/feed.xml" />
-  <updated>2023-03-01T02:39:08Z</updated>
+  <updated>2023-03-29T03:38:45Z</updated>
 
   <author>
     <name>Les Hazlewood</name>
diff --git a/jakarta-ee.html b/jakarta-ee.html
index 0f7c50d67..795443ec4 100644
--- a/jakarta-ee.html
+++ b/jakarta-ee.html
@@ -526,7 +526,7 @@ public class MyBean {
 
     @Inject
     @Principal
-    Optional&lt;MyUserAccount&gt; userAccount;
+    ShiroPrincipal&lt;MyUserAccount&gt; userAccount;
 
     @Inject
     Session session;
@@ -538,10 +538,9 @@ public class MyBean {
 </div>
 </div>
 <div class="paragraph">
-<p><code>Subject</code>, <code>Session</code> and <code>@Principal</code> are always treated as Request-Scoped beans.<br>
-If <code>Session</code> is annotated with <code>@NoSessionCreation</code> and if there is no existing session, <code>InvalidSessionException</code> is thrown when accessing the Injected session.
-Any Shiro Principal can be injected if annotated by <code>@Principal</code>. It must be injected as a Java optional, and may not be
-present if Shiro cannot retrieve it.</p>
+<p><code>Subject</code>, <code>Session</code> and <code>ShiroPrincipal</code> are always treated as Request-Scoped beans. They are injectable into any Jakarta EE bean including Jax-RS, Servlet and other CDI beans.<br>
+If <code>Session</code> is annotated with <code>@NoSessionCreation</code> and there is no existing session, <code>InvalidSessionException</code> is thrown when accessing the Injected session.<br>
+Any Shiro principal object can be injected if annotated by <code>@Principal</code>. It must be injected as <code>ShiroPrincipal</code>, and <code>ShiroPrincipal.get()</code> may return null if there are no principals available of the injected type.</p>
 </div>
 </div>
 </div>