From 7577c4cbd428693b943842fd272b4fd4cbc92489 Mon Sep 17 00:00:00 2001 From: brentstormpath Date: Wed, 21 Jan 2015 16:40:50 -0800 Subject: [PATCH 1/4] Update README.md --- README.md | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dca35e1..44151ff 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,40 @@ Copyright © 2013-2014 Stormpath, Inc. and contributors. This project is open-source via the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0). The `stormpath-shiro` plugin allows an [Apache Shiro](http://shiro.apache.org)-enabled application -use the [Stormpath](http://www.stormpath.com) User Management & Authentication service for all authentication and access control needs. +use the [Stormpath](http://www.stormpath.com) User Management & Authentication API for all authentication and access control needs. + +Stormpath is a User Management API that reduces development time with instant-on, scalable user infrastructure. Stormpath's intuitive API and expert support make it easy for developers to authenticate, manage, and secure users and roles in any application. Pairing Shiro with Stormpath gives you a full application security system complete with immediate user account support, authentication, account registration and password reset workflows, password security and more - with little to no coding on your part. -Usage documentation [is in the wiki](https://github.com/stormpath/stormpath-shiro/wiki). +## Documentation + +Stormpath offers usage documentation and support for the Apache Shiro Plugin for Stormpath [in the wiki](https://github.com/stormpath/stormpath-shiro/wiki). + +Please email support@stormpath.com with any errors or issues with the documentation. + +## Links + +Below are some resources you might find useful! + +- [Apache Shiro Webapp Tutorial](http://shiro.apache.org/webapp-tutorial.html) +- [Stormpath-Shiro Sample Webapp](https://github.com/stormpath/stormpath-shiro-web-sample) + +- [Stormpath API Docs for Java](https://docs.stormpath.com/java/apidocs/) +- [Stormpath Java Product Guide](https://docs.stormpath.com/java/product-guide/) +- [Stormpath Java SDK](https://github.com/stormpath/stormpath-sdk-java) +- [Stormpath Servlet Plugin for Java Webapps](https://docs.stormpath.com/java/servlet-plugin/) + +## Contributing + +Contributions, bug reports and issues are very welcome. Stormpath regularly maintains this repository, and are quick to review pull requests and accept changes! + +You can make your own contributions by forking the develop branch of this +repository, making your changes, and issuing pull request on the develop branch. -### Build Instructions ### +## Build Instructions ## This project requires Maven 3 to build. Run the following from a command prompt: From 19d1c6bf9adb94f21fdb7bf5f27344acdf322775 Mon Sep 17 00:00:00 2001 From: brentstormpath Date: Wed, 21 Jan 2015 16:42:24 -0800 Subject: [PATCH 2/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44151ff..28d3106 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,10 @@ Please email support@stormpath.com with any errors or issues with the documentat ## Links Below are some resources you might find useful! - - [Apache Shiro Webapp Tutorial](http://shiro.apache.org/webapp-tutorial.html) - [Stormpath-Shiro Sample Webapp](https://github.com/stormpath/stormpath-shiro-web-sample) +**Stormpath Java Support** - [Stormpath API Docs for Java](https://docs.stormpath.com/java/apidocs/) - [Stormpath Java Product Guide](https://docs.stormpath.com/java/product-guide/) - [Stormpath Java SDK](https://github.com/stormpath/stormpath-sdk-java) From 7518993315aed8026ce58178478081bc201cae6e Mon Sep 17 00:00:00 2001 From: brentstormpath Date: Wed, 21 Jan 2015 18:48:50 -0800 Subject: [PATCH 3/4] Updating Readme and adding separate changelog file. --- README.md | 99 +++------------------------------------------------- changelog.md | 93 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 95 deletions(-) create mode 100644 changelog.md diff --git a/README.md b/README.md index 28d3106..c89a7c9 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ # Apache Shiro plugin for Stormpath # -Copyright © 2013-2014 Stormpath, Inc. and contributors. This project is open-source via the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0). - The `stormpath-shiro` plugin allows an [Apache Shiro](http://shiro.apache.org)-enabled application use the [Stormpath](http://www.stormpath.com) User Management & Authentication API for all authentication and access control needs. @@ -15,9 +13,7 @@ with little to no coding on your part. ## Documentation -Stormpath offers usage documentation and support for the Apache Shiro Plugin for Stormpath [in the wiki](https://github.com/stormpath/stormpath-shiro/wiki). - -Please email support@stormpath.com with any errors or issues with the documentation. +Stormpath offers usage documentation and support for the Apache Shiro Plugin for Stormpath [in the wiki](https://github.com/stormpath/stormpath-shiro/wiki). Please email support@stormpath.com with any errors or issues with the documentation. ## Links @@ -44,99 +40,12 @@ This project requires Maven 3 to build. Run the following from a command prompt `mvn install` -## Change Log - -### 0.6.0 - -- Upgraded Shiro dependency to latest stable release of 1.2.3 -- Upgraded Stormpath SDK dependency to latest released version: 1.0.RC2 -- [Issue 6](https://github.com/stormpath/stormpath-shiro/issues/6): Fixed bug that prevented Authentication data to be removed from cache after a successful logout. - -### 0.5.0 - -- Upgraded Stormpath SDK dependency to latest stable release of 0.9.1 -- Added Permission support! It is now possible to assign Shiro permissions to Stormpath Accounts or Groups by leveraging Stormpath's newly released [CustomData](http://docs.stormpath.com/rest/product-guide/#custom-data) feature. You can add and remove permission to an Account or Group by modifying that account or group's CustomData resource. For example: - -```java -Account account = getAccount(); //lookup account - -//edit the permisssions assigned to the Account: -new CustomDataPermissionsEditor(account.getCustomData()) - .append("user:1234:edit") - .append("document:*") - .remove("printer:*:print"); - -//persist the account's permission changes: -account.save(); -``` - -The same `CustomDataPermissionsEditor` can be used to assign permissions to Groups as well, and assumes 'transitive association': any permissions assigned to a Group are also 'inherited' to the Accounts in the Group. - -In other words, an account's total assigned permissions are any permissions assigned directly to the account, plus, all of the permissions assigned to any Group that contains the account. - -The `CustomDataPermissionsEditor` will save the permissions as a JSON list in the CustomData resource, under the default `apacheShiroPermissions` field name, for example: - -```json -{ - ... any other of your own custom data properties ..., - - "apacheShiroPermissions": [ - "perm1", - "perm2", - ..., - "permN" - ] -} -``` -If you would like to change the default field name, you can call the `setFieldName` method: - -```java -new CustomDataPermissionsEditor(account.getCustomData()) - .setFieldName("whateverYouWantHere") - .append("user:1234:edit") - .append("document:*") - .remove("printer:*:print"); -``` - -But you'll also need to update your `ApplicationRealm`'s configuration to reflect the new name so it can function - the realm reads the same `CustomData` field, so they must be identical to ensure both read and write scenarios access the same field. For example, if using `shiro.ini`: - - stormpathRealm.groupPermissionResolver.customDataFieldName = whateverYouWantHere - stormpathRealm.accountPermissionResolver.customDataFieldName = whateverYouWantHere - -- The `ApplicationRealm` implementation now has a default `groupPermissionResolver` and `accountPermissionResolver` properties that leverage respective group or account `CustomData` to support permissions as described above. Prior to this 0.5.0 release, there were no default implementations of these properties - you had to implement the interfaces yourself to support permissions. Now Permissions are built in by default (although you could still provide your own custom implementations if you have custom needs of course). - -### 0.4.0 - -- Upgraded Stormpath SDK dependency to latest stable release of 0.8.1 -- Added CacheManager/Cache bridging support. This allows the Stormpath SDK to use the same caching mechanism that you're already using for Shiro, simplifying cache configuration/setup. For example: - -```ini -[main] - -cacheManager = my.shiro.CacheManagerImplementation -securityManager.cacheManager = $cacheManager - -# Stormpath integration: -stormpathClient = com.stormpath.shiro.client.ClientFactory -# etc... -stormpathClient.cacheManager = $cacheManager -``` - -If for some reason you *don't* want the Stormpath SDK to use Shiro's caching mechanism, you can configure the `stormpathCacheManager` property (instead of the expected Shiro-specific `cacheManager` property), which accepts a `com.stormpath.sdk.cache.CacheManager` instance instead: - -```ini -# ... -stormpathCacheManager = my.com.stormpath.sdk.cache.CacheManagerImplementation -# etc... -stormpathClient.stormpathCacheManager = $stormpathCacheManager -``` -But note this approach requires you to set-up/configure two separate caching mechanisms. +## Copyright ## -See ClientFactory `setCacheManager` and `setStormpathCacheManager` JavaDoc for more. +Copyright © 2013-2015 Stormpath, Inc. and contributors. -### 0.3.1 +This project is open-source via the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0). -0.3.1 is a minor dependency fix: the Stormpath Java SDK dependency has been upgraded to reflect its latest 0.8.0 release. This is the only change - no additional features/changes have been made otherwise. diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..3159a93 --- /dev/null +++ b/changelog.md @@ -0,0 +1,93 @@ +## Change Log ## + +### 0.6.0 + +- Upgraded Shiro dependency to latest stable release of 1.2.3 +- Upgraded Stormpath SDK dependency to latest released version: 1.0.RC2 +- [Issue 6](https://github.com/stormpath/stormpath-shiro/issues/6): Fixed bug that prevented Authentication data to be removed from cache after a successful logout. + +### 0.5.0 + +- Upgraded Stormpath SDK dependency to latest stable release of 0.9.1 +- Added Permission support! It is now possible to assign Shiro permissions to Stormpath Accounts or Groups by leveraging Stormpath's newly released [CustomData](http://docs.stormpath.com/rest/product-guide/#custom-data) feature. You can add and remove permission to an Account or Group by modifying that account or group's CustomData resource. For example: + +```java +Account account = getAccount(); //lookup account + +//edit the permisssions assigned to the Account: +new CustomDataPermissionsEditor(account.getCustomData()) + .append("user:1234:edit") + .append("document:*") + .remove("printer:*:print"); + +//persist the account's permission changes: +account.save(); +``` + +The same `CustomDataPermissionsEditor` can be used to assign permissions to Groups as well, and assumes 'transitive association': any permissions assigned to a Group are also 'inherited' to the Accounts in the Group. + +In other words, an account's total assigned permissions are any permissions assigned directly to the account, plus, all of the permissions assigned to any Group that contains the account. + +The `CustomDataPermissionsEditor` will save the permissions as a JSON list in the CustomData resource, under the default `apacheShiroPermissions` field name, for example: + +```json +{ + ... any other of your own custom data properties ..., + + "apacheShiroPermissions": [ + "perm1", + "perm2", + ..., + "permN" + ] +} +``` +If you would like to change the default field name, you can call the `setFieldName` method: + +```java +new CustomDataPermissionsEditor(account.getCustomData()) + .setFieldName("whateverYouWantHere") + .append("user:1234:edit") + .append("document:*") + .remove("printer:*:print"); +``` + +But you'll also need to update your `ApplicationRealm`'s configuration to reflect the new name so it can function - the realm reads the same `CustomData` field, so they must be identical to ensure both read and write scenarios access the same field. For example, if using `shiro.ini`: + + stormpathRealm.groupPermissionResolver.customDataFieldName = whateverYouWantHere + stormpathRealm.accountPermissionResolver.customDataFieldName = whateverYouWantHere + +- The `ApplicationRealm` implementation now has a default `groupPermissionResolver` and `accountPermissionResolver` properties that leverage respective group or account `CustomData` to support permissions as described above. Prior to this 0.5.0 release, there were no default implementations of these properties - you had to implement the interfaces yourself to support permissions. Now Permissions are built in by default (although you could still provide your own custom implementations if you have custom needs of course). + +### 0.4.0 + +- Upgraded Stormpath SDK dependency to latest stable release of 0.8.1 +- Added CacheManager/Cache bridging support. This allows the Stormpath SDK to use the same caching mechanism that you're already using for Shiro, simplifying cache configuration/setup. For example: + +```ini +[main] + +cacheManager = my.shiro.CacheManagerImplementation +securityManager.cacheManager = $cacheManager + +# Stormpath integration: +stormpathClient = com.stormpath.shiro.client.ClientFactory +# etc... +stormpathClient.cacheManager = $cacheManager +``` + +If for some reason you *don't* want the Stormpath SDK to use Shiro's caching mechanism, you can configure the `stormpathCacheManager` property (instead of the expected Shiro-specific `cacheManager` property), which accepts a `com.stormpath.sdk.cache.CacheManager` instance instead: + +```ini +# ... +stormpathCacheManager = my.com.stormpath.sdk.cache.CacheManagerImplementation +# etc... +stormpathClient.stormpathCacheManager = $stormpathCacheManager +``` +But note this approach requires you to set-up/configure two separate caching mechanisms. + +See ClientFactory `setCacheManager` and `setStormpathCacheManager` JavaDoc for more. + +### 0.3.1 + +0.3.1 is a minor dependency fix: the Stormpath Java SDK dependency has been upgraded to reflect its latest 0.8.0 release. This is the only change - no additional features/changes have been made otherwise. \ No newline at end of file From ba09c9c25153c6c6b521d2003e07030ace09625a Mon Sep 17 00:00:00 2001 From: brentstormpath Date: Wed, 21 Jan 2015 18:54:38 -0800 Subject: [PATCH 4/4] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c89a7c9..873253e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Apache Shiro plugin for Stormpath # -The `stormpath-shiro` plugin allows an [Apache Shiro](http://shiro.apache.org)-enabled application +The `stormpath-shiro` plugin allows an [Apache Shiro](http://shiro.apache.org)-enabled application to use the [Stormpath](http://www.stormpath.com) User Management & Authentication API for all authentication and access control needs. Stormpath is a User Management API that reduces development time with instant-on, scalable user infrastructure. Stormpath's intuitive API and expert support make it easy for developers to authenticate, manage, and secure users and roles in any application. @@ -40,6 +40,8 @@ This project requires Maven 3 to build. Run the following from a command prompt `mvn install` +Release changes are viewable in the [change log](changelog.md) + ## Copyright ## Copyright © 2013-2015 Stormpath, Inc. and contributors.