From 06f5343751250bb41c8b1a13c235e69bc26e8182 Mon Sep 17 00:00:00 2001 From: Brian Demers Date: Mon, 24 Oct 2016 18:09:57 -0400 Subject: [PATCH] Move "related links" sections out of markdown and into a new layout template --- assets/js/shiro-site.js | 10 +- authentication-features.md | 25 ---- authorization-features.md | 24 ---- cas.md.vtl | 10 -- config.scms.groovy | 217 ++++++++++++++++++++++++++++++- java-authentication-guide.md.vtl | 19 --- java-authorization-guide.md.vtl | 22 ---- mailing-lists.md | 57 -------- mailing-lists.md.vtl | 16 +++ permissions.md | 21 --- session-management.md.vtl | 27 ---- spring.md | 12 -- templates/default.vtl | 6 +- templates/layouts/related.vtl | 19 +++ tutorial.md.vtl | 16 --- web-features.md | 18 --- web.md.vtl | 25 ---- 17 files changed, 256 insertions(+), 288 deletions(-) delete mode 100644 mailing-lists.md create mode 100644 mailing-lists.md.vtl create mode 100644 templates/layouts/related.vtl diff --git a/assets/js/shiro-site.js b/assets/js/shiro-site.js index 9a74c7664d..19584b27b3 100644 --- a/assets/js/shiro-site.js +++ b/assets/js/shiro-site.js @@ -7,10 +7,10 @@ function addPageEditLink() { var ghEditPageElement = $( "#ghEditPage" ); var editThisPageElement = $(".editThisPage"); - if (ghEditPageElement && ghEditPageElement.val() && editThisPageElement) { - var relGHPage = ghEditPageElement.val(); + if (ghEditPageElement && ghEditPageElement.val() && editThisPageElement) { + var relGHPage = ghEditPageElement.val(); - var ghEditHref = ghRelHref + relGHPage; - editThisPageElement.append("Edit this Page on Github"); - } + var ghEditHref = ghRelHref + relGHPage; + editThisPageElement.append("Edit this Page on Github"); + } } \ No newline at end of file diff --git a/authentication-features.md b/authentication-features.md index ffe691f979..f98442e646 100644 --- a/authentication-features.md +++ b/authentication-features.md @@ -8,31 +8,6 @@ The Shiro framework is designed to make authentication as clean and intuitive as ## Features - - - - - -
-
-

Related Content

- -

Java Authentication Guide

-

Learn how Authentication in Java is performed in Shiro.
Read More >>

- -

Authentication Docs

-

Full documentation on Shiro's Authentication functionality.
Read More >>

- -

Getting Started

-

Resources, guides and tutorials for new Shiro users.
Read More >>

- -

Web App Tutorial

-

Step-by-step tutorial for securing a web application with Shiro.
Read More >>

- -
-
- - * **Subject Based** - Almost everything you do in Shiro is based on the currently executing user, called a Subject. And you can easily retrieve the Subject anywhere in your code. This makes it easier for you to understand and work with Shiro in your applications. * **Single Method call** - The authentication process is a single method call. Needing only one method call keeps the API simple and your application code clean, saving you time and effort. diff --git a/authorization-features.md b/authorization-features.md index 242a0a6d42..ef2f44ade9 100644 --- a/authorization-features.md +++ b/authorization-features.md @@ -8,30 +8,6 @@ Authorization is a critical element of any application but it can quickly become ## Features - - - - - -
-
-

Related Content

- -

Java Authorization Guide

-

Learn how Shiro handles access control in Java.
Read More >>

- -

Authorization Docs

-

Full documentation on Apache Shiro's Authorization functionality.
Read More >>

- -

Getting Started

-

Resources, guides and tutorials for new Shiro users.
Read More >>

- -

Web App Tutorial

-

Step-by-step tutorial for securing a web application with Shiro.
Read More >>

- -
-
- * **Subject-based** - Almost everything you do in Shiro is based on the currently executing user, called a Subject. And you can easily access the subject retrieve the Subject and checks its roles, permissions, or other relevant attributes anywhere in your code. This makes it easier for you to understand and work with Shiro in your applications. * **Checks based on roles or permissions** - Since the complexity of authorization differs greatly between applications, Shiro is designed to be flexible, supporting both role-based security and permission-based security based on your projects needs. diff --git a/cas.md.vtl b/cas.md.vtl index 070139bb5a..18ad3393c6 100644 --- a/cas.md.vtl +++ b/cas.md.vtl @@ -4,16 +4,6 @@ Integrating Apache Shiro with CAS SSO server #warning('NOTE:', 'Shiro-CAS support is deprecated, support has been moved to the Apache Shiro based buji-pac4j project.') -
-
- -

Related Content

-

Web Apps with Shiro

-

Learn more about integrating Shiro into web applications.
Read More >>

- -
-
- The _shiro-cas_ module is made to protect a web application with a [Jasig CAS](https://wiki.jasig.org/display/CAS/Home) SSO server. It enables a Shiro-enabled application to be a CAS client. diff --git a/config.scms.groovy b/config.scms.groovy index 2b344f2b79..48ddbc87f1 100644 --- a/config.scms.groovy +++ b/config.scms.groovy @@ -8,37 +8,242 @@ scms { // year = Calendar.getInstance.get(Calendar.YEAR) //} + // [title: 'title', href: 'href', brief: 'brief'], + + + + gettingStartedLink = [title: 'Getting Started', href: 'get-started.html', brief: 'Resources, guides and tutorials for new Shiro users.'] + tenMinuiteTutorialLink = [title: '10-Minute Shiro Tutorial', href: '10-minute-tutorial.html', brief: 'Try Apache Shiro for yourself in under 10 minutes.'] + webAppTutorialLink = [title: 'Web App Tutorial', href: 'webapp-tutorial.html', brief: 'Step-by-step tutorial for securing a web application with Shiro.'] + authcGuideLink = [title: 'Java Authentication Guide', href: 'java-authentication-guide.html', brief: 'Learn how Authentication in Java is performed in Shiro.'] + authzGuideLink = [title: 'Java Authorization Guide', href: 'java-authorization-guide.html', brief: 'Learn how Shiro handles access control in Java.'] + webLink = [title: 'Web Apps with Shiro', href: 'web.html', brief: 'Detailed support for integrating Shiro into web applications.'] + webFeaturesLink = [title: 'Web Apps with Shiro', href: 'web-features.html', brief: 'Learn more about integrating Shiro into web applications.'] + authzDocs = [title: 'Authorization Docs', href: 'authorization.html', brief: 'Full documentation on Apache Shiro\'s Authorization functionality.'] + authcDocs = [title: 'Authentication Docs', href: 'authentication.html', brief: 'Full documentation on Shiro\'s Authentication functionality.'] + + + + authcGuideRelatedLinks = [ + [title: 'Authentication Features', href: 'authentication-features.html', brief: 'Quick overview of easy, subject-based authentication in Shiro.'], + authcDocs, + tenMinuiteTutorialLink, + webAppTutorialLink + ] + + authcFeaturesRelatedLinks = [ + authcGuideLink, + authcDocs, + gettingStartedLink, + webAppTutorialLink + ] + + + authzFeaturesRelatedLinks = [ + authzGuideLink, + authzDocs, + gettingStartedLink, + webAppTutorialLink + ] + + casRelatedLinks = [ + webFeaturesLink + ] + + authzGuideRelatedLinks = [ + [title: 'Authorization Features', href: 'authorization-features.html', brief: 'Quick overview of permissions, roles, and users in Shiro.'], + [title: 'Authorization Docs', href: 'authorization.html', brief: 'Full documentation on Apache Shiro\'s Authorization functionality.'], + gettingStartedLink, + tenMinuiteTutorialLink, + webAppTutorialLink + ] + + permissionsRelatedLinks = [ + authzGuideLink, + webAppTutorialLink, + gettingStartedLink, + tenMinuiteTutorialLink + ] + sessionManagementRelatedLinks = [ + gettingStartedLink, + tenMinuiteTutorialLink, + webAppTutorialLink, + authcGuideLink, + authzGuideLink + ] + + springRelatedLinks = [ + webLink, + webAppTutorialLink + ] + + tutorialRelatedLinks = [ + gettingStartedLink, + tenMinuiteTutorialLink, + webAppTutorialLink, + ] + + webFeaturesRelatedLinks = [ + webAppTutorialLink, + webLink + ] + + webRelatedLinks = [ + webFeaturesLink, + webAppTutorialLink, + [title: 'Session Management', href: 'session-management-features.html', brief: 'Shiro enables sessions for any application environment. Learn more!'], + [title: 'Permissions', href: 'permissions.html', brief: 'Learn more about Shiro\'s powerful and intuitive permission syntax.'], + authcGuideLink, + authzGuideLink + ] + patterns { - 'static/**/*.html' { - template = 'templates/none.vtl' + '**/web.md.vtl' { + template = 'templates/default.vtl' + model { + //the above template uses the year for a copyright notice: + year = Calendar.getInstance().get(Calendar.YEAR) + layout = 'templates/layouts/related.vtl' + relatedLinks = webRelatedLinks + topSpacing = '60px' + } } - '**/*.html' { + '**/web-features.md' { template = 'templates/default.vtl' model { //the above template uses the year for a copyright notice: year = Calendar.getInstance().get(Calendar.YEAR) + layout = 'templates/layouts/related.vtl' + relatedLinks = webFeaturesRelatedLinks + } } - '**/*.md' { + '**/session-management.md.vtl' { template = 'templates/default.vtl' model { //the above template uses the year for a copyright notice: year = Calendar.getInstance().get(Calendar.YEAR) + layout = 'templates/layouts/related.vtl' + relatedLinks = sessionManagementRelatedLinks + topSpacing = '60px' + } } - '**/*.vtl' { + '**/tutorial.md.vtl' { + template = 'templates/default.vtl' + model { + //the above template uses the year for a copyright notice: + year = Calendar.getInstance().get(Calendar.YEAR) + layout = 'templates/layouts/related.vtl' + relatedLinks = tutorialRelatedLinks + topSpacing = '60px' + + } + } + + '**/spring.md' { template = 'templates/default.vtl' model { //the above template uses the year for a copyright notice: year = Calendar.getInstance().get(Calendar.YEAR) + layout = 'templates/layouts/related.vtl' + relatedLinks = springRelatedLinks + + } + } + + '**/permissions.md' { + template = 'templates/default.vtl' + model { + //the above template uses the year for a copyright notice: + year = Calendar.getInstance().get(Calendar.YEAR) + layout = 'templates/layouts/related.vtl' + relatedLinks = permissionsRelatedLinks + topSpacing = '60px' + + } + } + + '**/java-authentication-guide.md.vtl' { + template = 'templates/default.vtl' + model { + //the above template uses the year for a copyright notice: + year = Calendar.getInstance().get(Calendar.YEAR) + layout = 'templates/layouts/related.vtl' + relatedLinks = authcGuideRelatedLinks + } } - '**/*.md.vtl' { + '**/java-authorization-guide.md.vtl' { + template = 'templates/default.vtl' + model { + //the above template uses the year for a copyright notice: + year = Calendar.getInstance().get(Calendar.YEAR) + layout = 'templates/layouts/related.vtl' + relatedLinks = authzGuideRelatedLinks + + } + } + + '**/authentication-features.md' { + template = 'templates/default.vtl' + model { + //the above template uses the year for a copyright notice: + year = Calendar.getInstance().get(Calendar.YEAR) + layout = 'templates/layouts/related.vtl' + relatedLinks = authzGuideRelatedLinks + + } + } + + '**/authorization-features.md' { + template = 'templates/default.vtl' + model { + //the above template uses the year for a copyright notice: + year = Calendar.getInstance().get(Calendar.YEAR) + layout = 'templates/layouts/related.vtl' + relatedLinks = authcFeaturesRelatedLinks + + } + } + + '**/cas.md.vtl' { + template = 'templates/default.vtl' + model { + //the above template uses the year for a copyright notice: + year = Calendar.getInstance().get(Calendar.YEAR) + layout = 'templates/layouts/related.vtl' + relatedLinks = casRelatedLinks + + } + } + + 'static/**/*.html' { + template = 'templates/none.vtl' + } + + '**/*.html' { + template = 'templates/default.vtl' + model { + //the above template uses the year for a copyright notice: + year = Calendar.getInstance().get(Calendar.YEAR) + } + } + + '**/*.md' { + template = 'templates/default.vtl' + model { + //the above template uses the year for a copyright notice: + year = Calendar.getInstance().get(Calendar.YEAR) + } + } + + '**/*.vtl' { template = 'templates/default.vtl' model { //the above template uses the year for a copyright notice: diff --git a/java-authentication-guide.md.vtl b/java-authentication-guide.md.vtl index cbbde6f4b7..056f784334 100644 --- a/java-authentication-guide.md.vtl +++ b/java-authentication-guide.md.vtl @@ -10,25 +10,6 @@ The goal of this guide is to walk you through how Authentication in Java is perf Terminology you'll need ----------------------- -
-
-

Related Content

- -

Authentication Features

-

Quick overview of easy, subject-based authentication in Shiro.
Read More >>

- -

Authentication Docs

-

Full documentation on Apache Shiro's Authentication functionality.
Read More >>

- -

10-Minute Shiro Tutorial

-

Try Apache Shiro for yourself in under 10 minutes.
Read More >>

- -

Web App Tutorial

-

Step-by-step tutorial for securing a web application with Shiro.
Read More >>

- -
-
- * **Subject** - Security specific user 'view' of an application user. It can be a human being, a third-party process, a server connecting to you application application, or even a cron job. Basically, it is anything or anyone communicating with your application. * **Principals** - A subjects identifying attributes. First name, last name, social security number, username diff --git a/java-authorization-guide.md.vtl b/java-authorization-guide.md.vtl index 0ee581d335..0794b4c606 100644 --- a/java-authorization-guide.md.vtl +++ b/java-authorization-guide.md.vtl @@ -15,28 +15,6 @@ Authorization has three core elements that we reference quite a bit in Shiro-- p #[[###Permissions Defined]]# -
-
-

Related Content

- -

Authorization Features

-

Quick overview of permissions, roles, and users in Shiro.
Read More >>

- -

Authorization Docs

-

Full documentation on Apache Shiro's Authorization functionality.
Read More >>

- -

Getting Started

-

Resources, guides and tutorials for new Shiro users.
Read More >>

- -

10-Minute Shiro Tutorial

-

Try Apache Shiro for yourself in under 10 minutes.
Read More >>

- -

Web App Tutorial

-

Step-by-step tutorial for securing a web application with Shiro.
Read More >>

- -
-
- Permissions are the most atomic level of a security policy and they are statements of functionality. Permissions represent what can be done in your application. A well formed permission describes a resource types and what actions are possible when you interact with those resources. Can you _open_ a _door_? Can you _read_ a _file_? Can you _delete_ a _customer record_? Can you _push_ a _button_? Common actions for data-related resources are create, read, update, and delete, commonly referred to as CRUD. diff --git a/mailing-lists.md b/mailing-lists.md deleted file mode 100644 index 9b7b3f8213..0000000000 --- a/mailing-lists.md +++ /dev/null @@ -1,57 +0,0 @@ - -#Apache Shiro Mailing Lists - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
List Name List Address Subscribe Unsubscribe ASF Archive Nabble (Online Forums)
Shiro User Listuser@shiro.apache.org - SubscribeUnsubscribeASF ArchiveNabble Forum and Archive
Shiro Developer Listdev@shiro.apache.orgSubscribeUnsubscribeASF ArchiveNabble Forum and Archive
Shiro SCM Listcommits@shiro.apache.org SubscribeUnsubscribeASF Archive
-
- - - -###Discussion Forums - -If you prefer you could use our discussion [Forums](forums.html "Forums") which are sync'd with the above mailing lists. - diff --git a/mailing-lists.md.vtl b/mailing-lists.md.vtl new file mode 100644 index 0000000000..2d0c604616 --- /dev/null +++ b/mailing-lists.md.vtl @@ -0,0 +1,16 @@ +#mdStyle() + + +#Apache Shiro Mailing Lists + +| List Name | List Address | Subscribe | Unsubscribe | ASF Archive | Nabble (Online Forums) | +|----------------------|-------------------------------------------------------------|--------------------------------------------------------|------------------------------------------------------------|------------------------------------------------------------------------|--------------------------------------------------------------------------| +| Shiro User List | [user@shiro.apache.org](mailto:user@shiro.apache.org) | [Subscribe](mailto:user-subscribe@shiro.apache.org) | [Unsubscribe](mailto:user-unsubscribe@shiro.apache.org) | [ASF Archive](http://mail-archives.apache.org/mod_mbox/shiro-user/) | [Nabble Forum and Archive](http://shiro-user.582556.n2.nabble.com/) | +| Shiro Developer List | [dev@shiro.apache.org](mailto:dev@shiro.apache.org) | [Subscribe](mailto:dev-subscribe@shiro.apache.org) | [Unsubscribe](mailto:dev-unsubscribe@shiro.apache.org) | [ASF Archive](http://mail-archives.apache.org/mod_mbox/shiro-dev/) | [Nabble Forum and Archive](http://shiro-developer.582600.n2.nabble.com/) | +| Shiro SCM List | [commits@shiro.apache.org](mailto:commits@shiro.apache.org) | [Subscribe](mailto:commits-subscribe@shiro.apache.org) | [Unsubscribe](mailto:commits-unsubscribe@shiro.apache.org) | [ASF Archive](http://mail-archives.apache.org/mod_mbox/shiro-commits/) | | + + +###Discussion Forums + +If you prefer you could use our discussion [Forums](forums.html "Forums") which are sync'd with the above mailing lists. + diff --git a/permissions.md b/permissions.md index 304d2eab67..2db1534d63 100644 --- a/permissions.md +++ b/permissions.md @@ -1,26 +1,5 @@ # Understanding Permissions in Apache Shiro -
- -
-

Related Content

- -

Java Authorization Guide

-

Learn how Shiro handles access control in Java.
Read More >>

- -

Web App Tutorial

-

Step-by-step tutorial for securing a web application with Shiro.
Read More >>

- -

Getting Started

-

Resources, guides and tutorials for new Shiro users.
Read More >>

- -

10-Minute Shiro Tutorial

-

Try Apache Shiro for yourself in under 10 minutes.
Read More >>

- -
- -
- Shiro defines a Permission as a statement that defines an explicit behavior or action. It is a statement of raw functionality in an application and nothing more. Permissions are the lowest-level constructs in security polices, and they explicitly define only "what" the application can do. They do _not_ at all describe "who" is able to perform the action(s). diff --git a/session-management.md.vtl b/session-management.md.vtl index 9c22d97ce5..1594dbea8b 100644 --- a/session-management.md.vtl +++ b/session-management.md.vtl @@ -1,33 +1,6 @@ #[[#Session Management]]# - - - - - -
-
-

Related Content

- -

Getting Started

-

Resources, guides and tutorials for new Shiro users.
Read More >>

- -

10-Minute Shiro Tutorial

-

Try Apache Shiro for yourself in under 10 minutes.
Read More >>

- -

Web App Tutorial

-

Step-by-step tutorial for securing a web application with Shiro.
Read More >>

- -

Java Authentication Guide

-

Learn how Authentication in Java is performed in Shiro.
Read More >>

- -

Java Authorization Guide

-

Learn how Shiro handles access control in Java.
Read More >>

- -
-
- * [Using Sessions](#SessionManagement-UsingSessions) * [The SessionManager](#SessionManagement-TheSessionManager) diff --git a/spring.md b/spring.md index 2e97ad620f..7f673ff293 100644 --- a/spring.md +++ b/spring.md @@ -1,18 +1,6 @@ #Integrating Apache Shiro into Spring-based Applications -
-
- -

Web Apps with Shiro

-

Detailed support for integrating Shiro into web applications.
Read More >>

- -

Web App Tutorial

-

Step-by-step tutorial for securing a web application with Shiro.
Read More >>

- -
-
- This page covers the ways to integrate Shiro into [Spring](http://spring.io)-based applications. Shiro's JavaBeans compatibility makes it perfectly suited to be configured via Spring XML or other Spring-based configuration mechanisms. Shiro applications need an application singleton `SecurityManager` instance. Note that this does not have to be a _static_ singleton, but there should only be a single instance used by the application, whether its a static singleton or not. diff --git a/templates/default.vtl b/templates/default.vtl index bcec194174..645d18aac5 100644 --- a/templates/default.vtl +++ b/templates/default.vtl @@ -94,7 +94,11 @@
- $content + #if ($layout) + #parse($layout) + #else + $content + #end
diff --git a/templates/layouts/related.vtl b/templates/layouts/related.vtl new file mode 100644 index 0000000000..2e05bc614c --- /dev/null +++ b/templates/layouts/related.vtl @@ -0,0 +1,19 @@ + +#if (!$topSpacing) + #set($topSpacing = '200px') +#end + + +
+ + + #if ($relatedLinks) +
+

Related Content

+ #foreach( $item in $relatedLinks ) +

$item.title

+

$item.brief
Read More >>

+ #end +
+ #end +$content \ No newline at end of file diff --git a/tutorial.md.vtl b/tutorial.md.vtl index bc5e121424..2002c73d2f 100644 --- a/tutorial.md.vtl +++ b/tutorial.md.vtl @@ -2,22 +2,6 @@ Apache Shiro Tutorial ===================== -
-
-

Related Content

- -

Getting Started

-

Resources, guides and tutorials for new Shiro users.
Read More >>

- -

10-Minute Shiro Tutorial

-

Try Apache Shiro for yourself in under 10 minutes.
Read More >>

- -

Web App Tutorial

-

Step-by-step tutorial for securing a web application with Shiro.
Read More >>

- -
-
- Your First Apache Shiro Application ----------------------------------- diff --git a/web-features.md b/web-features.md index 93f165891e..1597034dcc 100644 --- a/web-features.md +++ b/web-features.md @@ -8,24 +8,6 @@ Although Apache Shiro is designed to be used to secure _any_ JVM-based applicati ##Features - - - - - -
-
-

Related Content

- -

Web App Tutorial

-

Step-by-step tutorial for securing a web application with Shiro.
Read More >>

- -

Web Support Docs

-

Detailed support for integrating Shiro into web applications.
Read More >>

- -
-
- * **Simple ShiroFilter web.xml definition** You can enable Shiro for a web application with one simple filter definition in web.xml. diff --git a/web.md.vtl b/web.md.vtl index 6b8e3f07de..8c4be46ad3 100644 --- a/web.md.vtl +++ b/web.md.vtl @@ -4,31 +4,6 @@ Apache Shiro Web Support ======================== -
-
-

Related Content

- -

Web Apps with Shiro

-

Learn more about integrating Shiro into web applications.
Read More >>

- -

Web App Tutorial

-

Step-by-step tutorial for securing a web application with Shiro.
Read More >>

- -

Session Management

-

Shiro enables sessions for any application environment. Learn more!
Read More >>

- -

Permissions

-

Learn more about Shiro's powerful and intuitive permission syntax.
Read More >>

- -

Java Authentication Guide

-

Learn how Authentication in Java is performed in Shiro.
Read More >>

- -

Java Authorization Guide

-

Learn how Shiro handles access control in Java.
Read More >>

- -
-
- * [Configuration](#Web-Configuration) * [`web.xml`](#Web-%7B%7Bweb.xml%7D%7D)