You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by aw...@apache.org on 2019/04/30 08:17:29 UTC

[fineract-cn-permitted-feign-client] branch develop updated (6ec6c01 -> d7ad870)

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

awasum pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git.


    from 6ec6c01  Merge pull request #4 from myrle-krantz/develop
     new 3804b78  FINCN-148 build with travis-ci.com and upload artifacts to Artifactory
     new f02f997  FINCN-148 build with travis-ci.com and upload artifacts to Artifactory
     new d7ad870  Merge pull request #5 from aasaru/artifactory

The 27 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .travis.yml                   | 30 ++++++++++++++++++
 README.md                     |  2 +-
 another-for-test/build.gradle |  5 +--
 api/build.gradle              |  3 +-
 build.gradle                  |  9 ++++++
 component-test/build.gradle   |  1 +
 library/build.gradle          |  3 +-
 shared.gradle                 | 17 +++++++++++
 travis.sh                     | 71 +++++++++++++++++++++++++++++++++++++++++++
 9 files changed, 136 insertions(+), 5 deletions(-)
 create mode 100644 .travis.yml
 create mode 100755 travis.sh


[fineract-cn-permitted-feign-client] 25/27: FINCN-148 build with travis-ci.com and upload artifacts to Artifactory

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 3804b7815f1dcfc1366d6b81ef5230fb015c5f43
Author: Juhan Aasaru <Ju...@nortal.com>
AuthorDate: Thu Apr 25 14:01:06 2019 +0300

    FINCN-148 build with travis-ci.com and upload artifacts to Artifactory
---
 .travis.yml                   | 30 ++++++++++++++++++
 README.md                     |  2 +-
 another-for-test/build.gradle |  5 +--
 api/build.gradle              |  3 +-
 build.gradle                  |  9 ++++++
 component-test/build.gradle   |  1 +
 library/build.gradle          |  3 +-
 shared.gradle                 | 17 +++++++++++
 travis.sh                     | 71 +++++++++++++++++++++++++++++++++++++++++++
 9 files changed, 136 insertions(+), 5 deletions(-)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..e9ea79e
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,30 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+language: java
+sudo: false
+jdk:
+- openjdk8
+install: true
+script: "./travis.sh"
+env:
+  global:
+    - BUILD_SNAPSHOTS_BRANCH=develop
+    - ARTIFACTORY_URL=https://mifos.jfrog.io/mifos
+    - ARTIFACTORY_USER=travis-ci
+    - secure: "VhvwetVLfBmMzlEAHuJZ8Uw5iNWoso5RMQw3/E7fHMa+brUd3ANR5oeXhVO/eUs3U9hKZZWtRYAhZbsNXLHv+oE8lO91re3WJLvJB1jZOXu4YP8fcOd3vPBXR3znTDHhZ9suzLFDgKDJPXb1ybNZuDXWwUggXmAPdyw2QTt7Wfh1kcfpP0P12sg2ONuEb4ns2fNQUuvE355SU9ZAyQSKnotgYJ0JazlV912CMxfhT4ir2gS1ufEnRjgKEwPfUrDFJs3N8ydHSo4KU7j5sdlAjylZMwOmM1tCqAyRImIycErxLpCD3Df97gHKc+aim832Ue0kXijrgBRBX30SFiLNUvpo18wMw6dsBuA03ht6n9b13TEgJKtqdSlGvQ+gS31Nz9yWWK0HoVY+3+kythha1qqF1CnsKPagOt4C+2osOEZ+pdWJWuM8+T/Add0qdQeNzcY3Dw5FgYSEMJyMxWvDrGSKJxb6a [...]
diff --git a/README.md b/README.md
index ef1e068..79651ac 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Apache Fineract CN Permitted Feign Client Library
+# Apache Fineract CN Permitted Feign Client Library [![Build Status](https://api.travis-ci.com/apache/fineract-cn-permitted-feign-client.svg?branch=develop)](https://travis-ci.com/apache/fineract-cn-permitted-feign-client)
 
 This project provides secured access to other services via Feign. For this it uses anubis and identity to provide refresh and access tokens transparently.
 
diff --git a/another-for-test/build.gradle b/another-for-test/build.gradle
index 844d116..3c983bb 100644
--- a/another-for-test/build.gradle
+++ b/another-for-test/build.gradle
@@ -32,6 +32,7 @@ buildscript {
 plugins {
     id 'com.github.hierynomus.license' version '0.13.1'
     id("org.nosphere.apache.rat") version "0.3.1"
+    id "com.jfrog.artifactory" version "4.9.5"
 }
 
 apply from: '../shared.gradle'
@@ -66,14 +67,14 @@ publishing {
             from components.java
             groupId project.group
             artifactId project.name
-            version project.version
+            version project.findProperty('externalVersion') ?: project.version
         }
         bootService(MavenPublication) {
             // "boot" jar
             artifact ("$buildDir/libs/$project.name-$version-boot.jar")
             groupId project.group
             artifactId ("service-boot")
-            version project.version
+            version project.findProperty('externalVersion') ?: project.version
         }
     }
 }
diff --git a/api/build.gradle b/api/build.gradle
index 0c393b6..1a034a9 100644
--- a/api/build.gradle
+++ b/api/build.gradle
@@ -29,6 +29,7 @@ buildscript {
 plugins {
     id 'com.github.hierynomus.license' version '0.13.1'
     id("org.nosphere.apache.rat") version "0.3.1"
+    id "com.jfrog.artifactory" version "4.9.5"
 }
 
 
@@ -56,7 +57,7 @@ publishing {
             from components.java
             groupId project.group
             artifactId project.name
-            version project.version
+            version project.findProperty('externalVersion') ?: project.version
         }
     }
 }
diff --git a/build.gradle b/build.gradle
index 4b0f9a2..4873b74 100644
--- a/build.gradle
+++ b/build.gradle
@@ -46,6 +46,15 @@ task publishToMavenLocal {
     dependsOn publishComponentTestToMavenLocal
 }
 
+task artifactoryPublish {
+    group 'all'
+    dependsOn publishToMavenLocal
+    dependsOn gradle.includedBuild('api').task(':artifactoryPublish')
+    dependsOn gradle.includedBuild('library').task(':artifactoryPublish')
+    dependsOn gradle.includedBuild('another-for-test').task(':artifactoryPublish')
+    dependsOn gradle.includedBuild('component-test').task(':artifactoryPublish')
+}
+
 task licenseFormat {
     group 'all'
     dependsOn gradle.includedBuild('api').task(':licenseFormat')
diff --git a/component-test/build.gradle b/component-test/build.gradle
index 84ebe43..01f5572 100644
--- a/component-test/build.gradle
+++ b/component-test/build.gradle
@@ -32,6 +32,7 @@ buildscript {
 plugins {
     id 'com.github.hierynomus.license' version '0.13.1'
     id("org.nosphere.apache.rat") version "0.3.1"
+    id "com.jfrog.artifactory" version "4.9.5"
 }
 
 apply from: '../shared.gradle'
diff --git a/library/build.gradle b/library/build.gradle
index b64e91e..b2af84a 100644
--- a/library/build.gradle
+++ b/library/build.gradle
@@ -28,6 +28,7 @@ buildscript {
 plugins {
     id 'com.github.hierynomus.license' version '0.13.1'
     id("org.nosphere.apache.rat") version "0.3.1"
+    id "com.jfrog.artifactory" version "4.9.5"
 }
 
 apply from: '../shared.gradle'
@@ -68,7 +69,7 @@ publishing {
             from components.java
             groupId project.group
             artifactId project.name
-            version project.version
+            version project.findProperty('externalVersion') ?: project.version
         }
     }
 }
diff --git a/shared.gradle b/shared.gradle
index 912a6fb..31f4c3b 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -45,6 +45,7 @@ tasks.withType(JavaCompile) {
 repositories {
     jcenter()
     mavenLocal()
+    maven { url 'https://mifos.jfrog.io/mifos/libs-snapshot/' }
 }
 
 configurations {
@@ -80,6 +81,22 @@ jar {
     from sourceSets.main.allSource
 }
 
+artifactory {
+    contextUrl = System.getenv("ARTIFACTORY_URL")
+    publish {
+        repository {
+            repoKey = project.findProperty('artifactoryRepoKey')
+            username = System.getenv("ARTIFACTORY_USER")
+            password = System.getenv("ARTIFACTORY_PASSWORD")
+        }
+
+        defaults {
+            publications ('apiPublication', 'libraryPublication', 'service', 'bootService')
+        }
+    }
+}
+artifactoryPublish.dependsOn('clean','publishToMavenLocal')
+
 license {
     header rootProject.file('../HEADER')
     strictCheck true
diff --git a/travis.sh b/travis.sh
new file mode 100755
index 0000000..03a75ee
--- /dev/null
+++ b/travis.sh
@@ -0,0 +1,71 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Documentation: https://cwiki.apache.org/confluence/display/FINERACT/Fineract-CN+Artifactory
+
+#Exit immediately if a command exits with a non-zero status.
+set -e
+EXIT_STATUS=0
+
+# Builds and Publishes a SNAPSHOT
+function build_snapshot() {
+  echo -e "Building and publishing a snapshot out of branch [$TRAVIS_BRANCH]"
+  ./gradlew -PartifactoryRepoKey=libs-snapshot-local -DbuildInfo.build.number=${TRAVIS_COMMIT::7} artifactoryPublish --stacktrace || EXIT_STATUS=$?
+}
+
+# Builds a Pull Request
+function build_pullrequest() {
+  echo -e "Building pull request #$TRAVIS_PULL_REQUEST of branch [$TRAVIS_BRANCH]. Won't publish anything to Artifactory."
+  ./gradlew publishToMavenLocal rat || EXIT_STATUS=$?
+}
+
+# For other branches we need to add branch name as prefix
+function build_otherbranch() {
+  echo -e "Building a snapshot out of branch [$TRAVIS_BRANCH] and publishing it with prefix '${TRAVIS_BRANCH}-SNAPSHOT'"
+  ./gradlew -PartifactoryRepoKey=libs-snapshot-local -DbuildInfo.build.number=${TRAVIS_COMMIT::7} -PexternalVersion=${TRAVIS_BRANCH}-SNAPSHOT artifactoryPublish --stacktrace || EXIT_STATUS=$?
+}
+
+# Builds and Publishes a Tag
+function build_tag() {
+  echo -e "Building tag [$TRAVIS_TAG] and publishing it as a release"
+  ./gradlew -PartifactoryRepoKey=libs-release-local -PexternalVersion=$TRAVIS_TAG artifactoryPublish --stacktrace || EXIT_STATUS=$?
+
+}
+
+echo -e "TRAVIS_BRANCH=$TRAVIS_BRANCH"
+echo -e "TRAVIS_TAG=$TRAVIS_TAG"
+echo -e "TRAVIS_COMMIT=${TRAVIS_COMMIT::7}"
+echo -e "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"
+
+# Build Logic
+if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
+  build_pullrequest
+elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" != "$BUILD_SNAPSHOTS_BRANCH" ] && [ "$TRAVIS_TAG" == "" ]  ; then
+  build_otherbranch
+elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "$BUILD_SNAPSHOTS_BRANCH" ] && [ "$TRAVIS_TAG" == "" ] ; then
+  build_snapshot
+elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
+  build_tag
+else
+  echo -e "WARN: Unexpected env variable values => Branch [$TRAVIS_BRANCH], Tag [$TRAVIS_TAG], Pull Request [#$TRAVIS_PULL_REQUEST]"
+  ./gradlew clean build
+fi
+
+exit ${EXIT_STATUS}


[fineract-cn-permitted-feign-client] 12/27: using EmptyBodyInterceptor to configure the client

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 6b8d1e53ec49294d346135d65756450ed38add79
Author: mgeiss <mg...@mifos.org>
AuthorDate: Wed Sep 27 07:32:45 2017 +0200

    using EmptyBodyInterceptor to configure the client
---
 .../permittedfeignclient/config/PermittedFeignClientConfiguration.java  | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
index c004aae..8b00584 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
@@ -21,6 +21,7 @@ import feign.gson.GsonDecoder;
 import feign.gson.GsonEncoder;
 import io.mifos.anubis.config.EnableAnubis;
 import io.mifos.core.api.util.AnnotatedErrorDecoder;
+import io.mifos.core.api.util.EmptyBodyInterceptor;
 import io.mifos.core.api.util.TenantedTargetInterceptor;
 import io.mifos.core.api.util.TokenedTargetInterceptor;
 import io.mifos.identity.api.v1.client.IdentityManager;
@@ -55,6 +56,7 @@ public class PermittedFeignClientConfiguration {
             .errorDecoder(new AnnotatedErrorDecoder(logger, IdentityManager.class))
             .requestInterceptor(new TenantedTargetInterceptor())
             .requestInterceptor(new TokenedTargetInterceptor())
+            .requestInterceptor(new EmptyBodyInterceptor())
             .decoder(new GsonDecoder())
             .encoder(new GsonEncoder())
             .target(IdentityManager.class, "http://identity-v1/identity/v1");


[fineract-cn-permitted-feign-client] 14/27: updating artifact ids to apache fineract from mifos io

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 38c1e0cdf0a02466e66897b3518305df60ffbf97
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Feb 26 18:07:08 2018 +0100

    updating artifact ids to apache fineract from mifos io
---
 another-for-test/build.gradle |  8 ++++----
 api/build.gradle              |  6 +++---
 build.gradle                  |  2 +-
 component-test/build.gradle   | 12 ++++++------
 library/build.gradle          | 12 ++++++------
 shared.gradle                 |  6 +++---
 6 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/another-for-test/build.gradle b/another-for-test/build.gradle
index 56ee324..7c7eb3c 100644
--- a/another-for-test/build.gradle
+++ b/another-for-test/build.gradle
@@ -31,11 +31,11 @@ dependencies {
             [group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka'],
             [group: 'org.springframework.boot', name: 'spring-boot-starter-jetty'],
             [group: 'org.hibernate', name: 'hibernate-validator', version: versions.hibernatevalidator],
-            [group: 'io.mifos.core', name: 'lang', version: versions.frameworklang],
-            [group: 'io.mifos.core', name: 'cassandra', version: versions.frameworkcassandra],
+            [group: 'org.apache.fineract.cn', name: 'lang', version: versions.frameworklang],
+            [group: 'org.apache.fineract.cn', name: 'cassandra', version: versions.frameworkcassandra],
             [group: 'io.jsonwebtoken', name: 'jjwt', version: versions.jjwt],
-            [group: 'io.mifos.anubis', name: 'api', version: versions.frameworkanubis],
-            [group: 'io.mifos.anubis', name: 'library', version: versions.frameworkanubis],
+            [group: 'org.apache.fineract.cn.anubis', name: 'api', version: versions.frameworkanubis],
+            [group: 'org.apache.fineract.cn.anubis', name: 'library', version: versions.frameworkanubis],
     )
 }
 
diff --git a/api/build.gradle b/api/build.gradle
index 1a5afae..a5a9150 100644
--- a/api/build.gradle
+++ b/api/build.gradle
@@ -23,12 +23,12 @@ dependencies {
             [group: 'org.springframework.cloud', name: 'spring-cloud-starter-feign'],
             [group: 'org.hibernate', name: 'hibernate-validator', version: versions.hibernatevalidator],
             [group: 'com.google.code.gson', name: 'gson'],
-            [group: 'io.mifos.core', name: 'api', version: versions.frameworkapi],
-            [group: 'io.mifos.identity', name: 'api', version: versions.frameworkidentity]
+            [group: 'org.apache.fineract.cn', name: 'api', version: versions.frameworkapi],
+            [group: 'org.apache.fineract.cn.identity', name: 'api', version: versions.frameworkidentity]
     )
 
     testCompile(
-            [group: 'io.mifos.core', name: 'test', version: versions.frameworktest],
+            [group: 'org.apache.fineract.cn', name: 'test', version: versions.frameworktest],
     )
 }
 
diff --git a/build.gradle b/build.gradle
index e2216eb..f5737f0 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,4 +1,4 @@
-group 'io.mifos'
+group 'org.apache.fineract.cn'
 
 task publishApiToMavenLocal {
     dependsOn gradle.includedBuild('api').task(':publishToMavenLocal')
diff --git a/component-test/build.gradle b/component-test/build.gradle
index 4ed858f..869b9d8 100644
--- a/component-test/build.gradle
+++ b/component-test/build.gradle
@@ -25,11 +25,11 @@ dependencies {
             [group: 'org.springframework.boot', name: 'spring-boot-starter-test'],
             [group: 'com.google.code.gson', name: 'gson'],
             [group: 'io.jsonwebtoken', name: 'jjwt', version: versions.jjwt],
-            [group: 'io.mifos.core', name: 'api', version: versions.frameworkapi],
-            [group: 'io.mifos.core', name: 'test', version: versions.frameworktest],
-            [group: 'io.mifos', name: 'service-starter', version: versions.frameworkservicestarter],
-            [group: 'io.mifos.permitted-feign-client', name: 'another-for-test', version: rootProject.version],
-            [group: 'io.mifos.permitted-feign-client', name: 'library', version: rootProject.version],
-            [group: 'io.mifos.permitted-feign-client', name: 'api', version: rootProject.version],
+            [group: 'org.apache.fineract.cn', name: 'api', version: versions.frameworkapi],
+            [group: 'org.apache.fineract.cn', name: 'test', version: versions.frameworktest],
+            [group: 'org.apache.fineract.cn', name: 'service-starter', version: versions.frameworkservicestarter],
+            [group: 'org.apache.fineract.cn.permitted-feign-client', name: 'another-for-test', version: rootProject.version],
+            [group: 'org.apache.fineract.cn.permitted-feign-client', name: 'library', version: rootProject.version],
+            [group: 'org.apache.fineract.cn.permitted-feign-client', name: 'api', version: rootProject.version],
     )
 }
diff --git a/library/build.gradle b/library/build.gradle
index 39c27a4..16838e1 100644
--- a/library/build.gradle
+++ b/library/build.gradle
@@ -29,12 +29,12 @@ dependencies {
             [group: 'org.springframework.cloud', name: 'spring-cloud-starter-security'],
             [group: 'org.hibernate', name: 'hibernate-validator', version: versions.hibernatevalidator],
             [group: 'io.jsonwebtoken', name: 'jjwt', version: versions.jjwt],
-            [group: 'io.mifos.core', name: 'lang', version: versions.frameworklang],
-            [group: 'io.mifos.core', name: 'api', version: versions.frameworkapi],
-            [group: 'io.mifos.core', name: 'cassandra', version: versions.frameworkcassandra],
-            [group: 'io.mifos.anubis', name: 'api', version: versions.frameworkanubis],
-            [group: 'io.mifos.anubis', name: 'library', version: versions.frameworkanubis],
-            [group: 'io.mifos.permitted-feign-client', name: 'api', version: rootProject.version],
+            [group: 'org.apache.fineract.cn', name: 'lang', version: versions.frameworklang],
+            [group: 'org.apache.fineract.cn', name: 'api', version: versions.frameworkapi],
+            [group: 'org.apache.fineract.cn', name: 'cassandra', version: versions.frameworkcassandra],
+            [group: 'org.apache.fineract.cn.anubis', name: 'api', version: versions.frameworkanubis],
+            [group: 'org.apache.fineract.cn.anubis', name: 'library', version: versions.frameworkanubis],
+            [group: 'org.apache.fineract.cn.permitted-feign-client', name: 'api', version: rootProject.version],
             [group: 'net.jodah', name: 'expiringmap', version: versions.expiringmap],
 
     )
diff --git a/shared.gradle b/shared.gradle
index ca25a25..fa4515c 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -1,4 +1,4 @@
-group 'io.mifos.permitted-feign-client'
+group 'org.apache.fineract.cn.permitted-feign-client'
 version '0.1.0-BUILD-SNAPSHOT'
 
 apply plugin: 'java'
@@ -31,7 +31,7 @@ repositories {
 }
 
 configurations {
-    compile.exclude group: 'io.mifos.core', module: 'mariadb'
+    compile.exclude group: 'org.apache.fineract.cn', module: 'mariadb'
     compile.exclude group: 'ch.vorburger', module: 'mariaDB4j'
 }
 
@@ -55,7 +55,7 @@ dependencies {
 
     testCompile(
             [group: 'org.springframework.boot', name: 'spring-boot-starter-test'],
-            [group: 'io.mifos.core', name: 'test', version: versions.frameworktest],
+            [group: 'org.apache.fineract.cn', name: 'test', version: versions.frameworktest],
     )
 }
 


[fineract-cn-permitted-feign-client] 09/27: Changed https to http. This may need to be made configurable when we use https in deployment. I'm still figuring out how ribbon/eureka determine which protocol to use.

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit aac6e4e1f0ea2afd1bc6dd3e3719c27b2138337b
Author: myrle-krantz <mk...@mifos.org>
AuthorDate: Thu Jun 1 09:54:21 2017 +0200

    Changed https to http.  This may need to be made configurable when we use https in deployment.  I'm still figuring out how ribbon/eureka determine which protocol to use.
---
 .../config/PermittedFeignClientConfiguration.java                    | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
index 2e3f442..41ff160 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
@@ -28,7 +28,6 @@ import io.mifos.permittedfeignclient.LibraryConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.cloud.netflix.feign.EnableFeignClients;
 import org.springframework.cloud.netflix.feign.support.SpringMvcContract;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -48,7 +47,7 @@ public class PermittedFeignClientConfiguration {
 
   @Bean
   public IdentityManager identityManager(
-          final @Nonnull Client feignClient,
+          @SuppressWarnings("SpringJavaAutowiringInspection") final @Nonnull Client feignClient,
           final @Qualifier(LibraryConstants.LOGGER_NAME) @Nonnull Logger logger) {
     return Feign.builder()
             .contract(new SpringMvcContract())
@@ -58,6 +57,6 @@ public class PermittedFeignClientConfiguration {
             .requestInterceptor(new TokenedTargetInterceptor())
             .decoder(new GsonDecoder())
             .encoder(new GsonEncoder())
-            .target(IdentityManager.class, "https://identity-v1");
+            .target(IdentityManager.class, "http://identity-v1");
   }
 }


[fineract-cn-permitted-feign-client] 24/27: Merge pull request #4 from myrle-krantz/develop

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 6ec6c01a5ccb3cd9c846c2550e7622c197168df9
Merge: 060c11b 507e9ec
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Apr 16 21:18:32 2018 +0200

    Merge pull request #4 from myrle-krantz/develop
    
    Updating package names.

 README.md                                          |  4 +-
 .../permittedfeignclient}/another/api/Another.java |  6 +-
 .../another/service/AnotherConfiguration.java      | 12 ++--
 .../another/service/AnotherRestController.java     |  6 +-
 .../client/ApplicationPermissionRequirements.java  |  4 +-
 .../api/v1/domain/ApplicationPermission.java       |  9 ++-
 .../src/main/java/TestAccessAnother.java           | 64 ++++++++++++----------
 .../main/java/accessanother/api/AccessAnother.java |  4 +-
 .../service/AccessAnotherConfiguration.java        |  8 +--
 .../service/AccessAnotherRestController.java       |  2 +-
 .../AnotherWithApplicationPermissions.java         |  6 +-
 .../cn}/permittedfeignclient/LibraryConstants.java |  2 +-
 .../annotation/EndpointSet.java                    |  2 +-
 .../PermittedFeignClientsConfiguration.java        | 14 ++---
 .../EnablePermissionRequestingFeignClient.java     |  2 +-
 ...ermittedFeignClientBeanDefinitionRegistrar.java |  4 +-
 .../config/PermittedFeignClientConfiguration.java  | 19 +++----
 .../config/PermittedFeignClientImportSelector.java |  6 +-
 ...cationPermissionRequirementsRestController.java | 14 ++---
 .../ApplicationTokenedTargetInterceptor.java       | 15 +++--
 .../service/ApplicationAccessTokenService.java     | 39 +++++++------
 .../ApplicationPermissionRequirementsService.java  | 14 ++---
 .../service/TokenCacheKey.java                     |  2 +-
 .../service/ApplicationAccessTokenServiceTest.java | 23 ++++----
 ...plicationPermissionRequirementsServiceTest.java | 21 ++++---
 25 files changed, 150 insertions(+), 152 deletions(-)


[fineract-cn-permitted-feign-client] 26/27: FINCN-148 build with travis-ci.com and upload artifacts to Artifactory

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit f02f99764b2834694b650d4333dbf8f178d8035e
Author: Juhan Aasaru <Ju...@nortal.com>
AuthorDate: Thu Apr 25 14:07:22 2019 +0300

    FINCN-148 build with travis-ci.com and upload artifacts to Artifactory
---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index e9ea79e..e823803 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,4 +27,4 @@ env:
     - BUILD_SNAPSHOTS_BRANCH=develop
     - ARTIFACTORY_URL=https://mifos.jfrog.io/mifos
     - ARTIFACTORY_USER=travis-ci
-    - secure: "VhvwetVLfBmMzlEAHuJZ8Uw5iNWoso5RMQw3/E7fHMa+brUd3ANR5oeXhVO/eUs3U9hKZZWtRYAhZbsNXLHv+oE8lO91re3WJLvJB1jZOXu4YP8fcOd3vPBXR3znTDHhZ9suzLFDgKDJPXb1ybNZuDXWwUggXmAPdyw2QTt7Wfh1kcfpP0P12sg2ONuEb4ns2fNQUuvE355SU9ZAyQSKnotgYJ0JazlV912CMxfhT4ir2gS1ufEnRjgKEwPfUrDFJs3N8ydHSo4KU7j5sdlAjylZMwOmM1tCqAyRImIycErxLpCD3Df97gHKc+aim832Ue0kXijrgBRBX30SFiLNUvpo18wMw6dsBuA03ht6n9b13TEgJKtqdSlGvQ+gS31Nz9yWWK0HoVY+3+kythha1qqF1CnsKPagOt4C+2osOEZ+pdWJWuM8+T/Add0qdQeNzcY3Dw5FgYSEMJyMxWvDrGSKJxb6a [...]
+    - secure: "EJtmkFC8+ZrIJbzd3joFlhG/W6aOZ7TR803UL5EMNZG0VktoFezudt72D5Ii221cMhgHu9YQsCdGO8hgIaW1UoR68eXsAAtmtneFef7uwJ5100DYTUVcvLQOR1pKRlNqox6Shu6ocSoqIfDvt07PbkmtKP10p7abLAuWs9d7ITOlgiWUkXIZdeKKkHrhSdcwXVRmOr+h2rL3RdA5w0r0seY+AM4Ng8jHG94YZcukJeaHTVADvLxHx+wk9+8vwIbLdVrCN18dlnCUDs5+jLPN0/cjLGs2CY8gY+XYPXqlDCoRwOU3sV/eCZFLZi+U9d9JLPEdGxcAB2PPxwUbR+bktxt1XigzpFq6/kR3dg5TNMseH4mN4V588TCiacOiEAM+h2J16bBfrTgZ8q3+m1qmsuJ2U13Kh3rTEApQMOt91sDVAhUpn4T4ml9+gTMyL3wX0iz9CumOx54b23FFiN55Rtu4pUTOC [...]


[fineract-cn-permitted-feign-client] 16/27: Updated copyright information

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit fcfcbfd50ef1e2b60fc82be60e13370bb7bc1394
Author: Isaac Kamga <u2...@gmail.com>
AuthorDate: Fri Mar 2 19:59:36 2018 +0100

    Updated copyright information
---
 HEADER                                             | 25 +++++++++++--------
 NOTICE.txt                                         |  5 ++++
 README.md                                          |  4 +--
 .../main/java/io/mifos/another/api/Another.java    | 25 +++++++++++--------
 .../another/service/AnotherConfiguration.java      | 25 +++++++++++--------
 .../another/service/AnotherRestController.java     | 25 +++++++++++--------
 another-for-test/src/main/resources/logback.xml    | 29 ++++++++++++----------
 .../client/ApplicationPermissionRequirements.java  | 25 +++++++++++--------
 .../api/v1/domain/ApplicationPermission.java       | 25 +++++++++++--------
 .../src/main/java/TestAccessAnother.java           | 25 +++++++++++--------
 .../main/java/accessanother/api/AccessAnother.java | 25 +++++++++++--------
 .../service/AccessAnotherConfiguration.java        | 25 +++++++++++--------
 .../service/AccessAnotherRestController.java       | 25 +++++++++++--------
 .../AnotherWithApplicationPermissions.java         | 25 +++++++++++--------
 .../permittedfeignclient/LibraryConstants.java     | 25 +++++++++++--------
 .../annotation/EndpointSet.java                    | 25 +++++++++++--------
 .../PermittedFeignClientsConfiguration.java        | 25 +++++++++++--------
 .../EnablePermissionRequestingFeignClient.java     | 25 +++++++++++--------
 ...ermittedFeignClientBeanDefinitionRegistrar.java | 25 +++++++++++--------
 .../config/PermittedFeignClientConfiguration.java  | 25 +++++++++++--------
 .../config/PermittedFeignClientImportSelector.java | 25 +++++++++++--------
 ...cationPermissionRequirementsRestController.java | 25 +++++++++++--------
 .../ApplicationTokenedTargetInterceptor.java       | 25 +++++++++++--------
 .../service/ApplicationAccessTokenService.java     | 25 +++++++++++--------
 .../ApplicationPermissionRequirementsService.java  | 25 +++++++++++--------
 .../service/TokenCacheKey.java                     | 25 +++++++++++--------
 .../service/ApplicationAccessTokenServiceTest.java | 25 +++++++++++--------
 ...plicationPermissionRequirementsServiceTest.java | 25 +++++++++++--------
 shared.gradle                                      |  2 +-
 29 files changed, 374 insertions(+), 291 deletions(-)

diff --git a/HEADER b/HEADER
index d47a70e..60b675e 100644
--- a/HEADER
+++ b/HEADER
@@ -1,13 +1,16 @@
-Copyright ${year} ${name}.
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
 
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
+  http://www.apache.org/licenses/LICENSE-2.0
 
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
diff --git a/NOTICE.txt b/NOTICE.txt
new file mode 100644
index 0000000..f55c3c7
--- /dev/null
+++ b/NOTICE.txt
@@ -0,0 +1,5 @@
+Apache Fineract CN Permitted Feign Client
+Copyright [2017-2018] The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
diff --git a/README.md b/README.md
index 1f44f4c..6df960f 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,11 @@
-# Mifos I/O Permitted Feign Client Library
+# Apache Fineract CN Permitted Feign Client Library
 
 [![Join the chat at https://gitter.im/mifos-initiative/mifos.io](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mifos-initiative/mifos.io?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
 
 This project provides secured access to other microservices via Feign. For this it uses anubis and identity to provide refresh and access tokens transparently.
 
 ## Abstract
-Mifos I/O is an application framework for digital financial services, a system to support nationwide and cross-national financial transactions and help to level and speed the creation of an inclusive, interconnected digital economy for every nation in the world.
+Apache Fineract CN is an application framework for digital financial services, a system to support nationwide and cross-national financial transactions and help to level and speed the creation of an inclusive, interconnected digital economy for every nation in the world.
 
 ## Versioning
 The version numbers follow the [Semantic Versioning](http://semver.org/) scheme.
diff --git a/another-for-test/src/main/java/io/mifos/another/api/Another.java b/another-for-test/src/main/java/io/mifos/another/api/Another.java
index 7b72fd4..a9678b2 100644
--- a/another-for-test/src/main/java/io/mifos/another/api/Another.java
+++ b/another-for-test/src/main/java/io/mifos/another/api/Another.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.another.api;
 
diff --git a/another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java b/another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java
index a3ade44..7802696 100644
--- a/another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java
+++ b/another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.another.service;
 
diff --git a/another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java b/another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java
index f1630a6..3397891 100644
--- a/another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java
+++ b/another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.another.service;
 
diff --git a/another-for-test/src/main/resources/logback.xml b/another-for-test/src/main/resources/logback.xml
index 73b6cf3..2f9fbd0 100644
--- a/another-for-test/src/main/resources/logback.xml
+++ b/another-for-test/src/main/resources/logback.xml
@@ -1,18 +1,21 @@
 <!--
 
-    Copyright 2017 The Mifos Initiative.
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 
 -->
 <configuration>
diff --git a/api/src/main/java/io/mifos/permittedfeignclient/api/v1/client/ApplicationPermissionRequirements.java b/api/src/main/java/io/mifos/permittedfeignclient/api/v1/client/ApplicationPermissionRequirements.java
index b3a971b..746b34d 100644
--- a/api/src/main/java/io/mifos/permittedfeignclient/api/v1/client/ApplicationPermissionRequirements.java
+++ b/api/src/main/java/io/mifos/permittedfeignclient/api/v1/client/ApplicationPermissionRequirements.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.api.v1.client;
 
diff --git a/api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java b/api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java
index 84e999e..9043811 100644
--- a/api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java
+++ b/api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.api.v1.domain;
 
diff --git a/component-test/src/main/java/TestAccessAnother.java b/component-test/src/main/java/TestAccessAnother.java
index c896c9d..f086b42 100644
--- a/component-test/src/main/java/TestAccessAnother.java
+++ b/component-test/src/main/java/TestAccessAnother.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 import accessanother.api.AccessAnother;
 import accessanother.service.AccessAnotherConfiguration;
diff --git a/component-test/src/main/java/accessanother/api/AccessAnother.java b/component-test/src/main/java/accessanother/api/AccessAnother.java
index ea1ad7d..4c1def7 100644
--- a/component-test/src/main/java/accessanother/api/AccessAnother.java
+++ b/component-test/src/main/java/accessanother/api/AccessAnother.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package accessanother.api;
 
diff --git a/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java b/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java
index 486d491..0f6d6a8 100644
--- a/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java
+++ b/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package accessanother.service;
 
diff --git a/component-test/src/main/java/accessanother/service/AccessAnotherRestController.java b/component-test/src/main/java/accessanother/service/AccessAnotherRestController.java
index 31f89e0..be6107b 100644
--- a/component-test/src/main/java/accessanother/service/AccessAnotherRestController.java
+++ b/component-test/src/main/java/accessanother/service/AccessAnotherRestController.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package accessanother.service;
 
diff --git a/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java b/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java
index f9ccc7e..d30cdc0 100644
--- a/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java
+++ b/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package accessanother.service.apiforother;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/LibraryConstants.java b/library/src/main/java/io/mifos/permittedfeignclient/LibraryConstants.java
index f9e4493..0995411 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/LibraryConstants.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/LibraryConstants.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/annotation/EndpointSet.java b/library/src/main/java/io/mifos/permittedfeignclient/annotation/EndpointSet.java
index def34f4..3f2ff7e 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/annotation/EndpointSet.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/annotation/EndpointSet.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.annotation;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java b/library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java
index cf84031..e8e86b9 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.annotation;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/EnablePermissionRequestingFeignClient.java b/library/src/main/java/io/mifos/permittedfeignclient/config/EnablePermissionRequestingFeignClient.java
index 93213dc..294eb0c 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/EnablePermissionRequestingFeignClient.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/config/EnablePermissionRequestingFeignClient.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.config;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientBeanDefinitionRegistrar.java b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientBeanDefinitionRegistrar.java
index 879e39b..d83dfae 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientBeanDefinitionRegistrar.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientBeanDefinitionRegistrar.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.config;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
index 8b00584..7bbed95 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.config;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientImportSelector.java b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientImportSelector.java
index 3ecb36c..e1469bd 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientImportSelector.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientImportSelector.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.config;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java b/library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java
index b34a147..a21f719 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.controller;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java b/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
index ecce505..7165b2d 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.security;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
index 1cb4554..2b1f2c0 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.service;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java
index a0450d3..278760b 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.service;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/TokenCacheKey.java b/library/src/main/java/io/mifos/permittedfeignclient/service/TokenCacheKey.java
index 1d203c6..b9919e8 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/service/TokenCacheKey.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/service/TokenCacheKey.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.service;
 
diff --git a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
index 6b366d3..e898e16 100644
--- a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
+++ b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.service;
 
diff --git a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java
index 1de7734..7942319 100644
--- a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java
+++ b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java
@@ -1,17 +1,20 @@
 /*
- * Copyright 2017 The Mifos Initiative.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 package io.mifos.permittedfeignclient.service;
 
diff --git a/shared.gradle b/shared.gradle
index fa4515c..78aaecf 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -73,7 +73,7 @@ license {
         yaml = 'SCRIPT_STYLE'
     }
     ext.year = Calendar.getInstance().get(Calendar.YEAR)
-    ext.name = 'The Mifos Initiative'
+    ext.name = 'The Apache Software Foundation'
 }
 
 task ci(dependsOn: ['clean', 'test', 'publish'])


[fineract-cn-permitted-feign-client] 04/27: Minor changes to access token acquisition so that it can be used in rhythm where we don't know in advance which application we'll be needing a token for.

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit bc6b05877f368083d72f8a31899632e7f7b23d6a
Author: myrle-krantz <mk...@mifos.org>
AuthorDate: Sun May 21 17:12:19 2017 +0200

    Minor changes to access token acquisition so that it can be used in rhythm where we don't know in advance which application we'll be needing a token for.
---
 .../ApplicationTokenedTargetInterceptor.java       |  3 +-
 .../service/ApplicationAccessTokenService.java     | 78 ++++++++--------------
 .../service/TokenCacheKey.java                     | 72 ++++++++++++++++++++
 .../service/ApplicationAccessTokenServiceTest.java | 23 ++++++-
 4 files changed, 121 insertions(+), 55 deletions(-)

diff --git a/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java b/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
index 4141d70..60a58ad 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
@@ -19,6 +19,7 @@ import feign.RequestInterceptor;
 import feign.RequestTemplate;
 import io.mifos.core.api.util.ApiConstants;
 import io.mifos.core.api.util.UserContextHolder;
+import io.mifos.core.lang.TenantContextHolder;
 import io.mifos.permittedfeignclient.annotation.EndpointSet;
 import io.mifos.permittedfeignclient.service.ApplicationAccessTokenService;
 import org.springframework.util.Assert;
@@ -48,7 +49,7 @@ public class ApplicationTokenedTargetInterceptor implements RequestInterceptor {
   public void apply(final RequestTemplate template) {
     UserContextHolder.getUserContext().ifPresent(userContext -> {
       template.header(ApiConstants.USER_HEADER, userContext.getUser());
-      template.header(ApiConstants.AUTHORIZATION_HEADER, applicationAccessTokenService.getAccessToken(userContext.getUser(), endpointSetIdentifier));
+      template.header(ApiConstants.AUTHORIZATION_HEADER, applicationAccessTokenService.getAccessToken(userContext.getUser(), TenantContextHolder.checkedGetIdentifier(), endpointSetIdentifier));
     });
   }
 }
\ No newline at end of file
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
index 082f5ec..c21752b 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
@@ -20,7 +20,7 @@ import io.mifos.anubis.security.AmitAuthenticationException;
 import io.mifos.anubis.token.TenantRefreshTokenSerializer;
 import io.mifos.anubis.token.TokenSerializationResult;
 import io.mifos.core.lang.ApplicationName;
-import io.mifos.core.lang.TenantContextHolder;
+import io.mifos.core.lang.AutoTenantContext;
 import io.mifos.core.lang.security.RsaKeyPairFactory;
 import io.mifos.identity.api.v1.client.IdentityManager;
 import io.mifos.identity.api.v1.domain.Authentication;
@@ -30,8 +30,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 import java.util.Map;
-import java.util.Objects;
 import java.util.Optional;
 import java.util.concurrent.TimeUnit;
 
@@ -41,41 +41,6 @@ import java.util.concurrent.TimeUnit;
 @Component
 public class ApplicationAccessTokenService {
   private static final long REFRESH_TOKEN_LIFESPAN = TimeUnit.SECONDS.convert(1, TimeUnit.MINUTES);
-  private static class TokenCacheKey {
-    final String user;
-    final String tenant;
-    final String endpointSet;
-
-    private TokenCacheKey(final String user, final String tenant, final String endpointSet) {
-      this.user = user;
-      this.tenant = tenant;
-      this.endpointSet = endpointSet;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-      if (this == o) return true;
-      if (o == null || getClass() != o.getClass()) return false;
-      TokenCacheKey that = (TokenCacheKey) o;
-      return Objects.equals(user, that.user) &&
-              Objects.equals(tenant, that.tenant) &&
-              Objects.equals(endpointSet, that.endpointSet);
-    }
-
-    @Override
-    public int hashCode() {
-      return Objects.hash(user, tenant, endpointSet);
-    }
-
-    @Override
-    public String toString() {
-      return "TokenCacheKey{" +
-              "user='" + user + '\'' +
-              ", tenant='" + tenant + '\'' +
-              ", endpointSet='" + endpointSet + '\'' +
-              '}';
-    }
-  }
 
   private final String applicationName;
   private final TenantSignatureRepository tenantSignatureRepository;
@@ -111,32 +76,41 @@ public class ApplicationAccessTokenService {
             .build();
   }
 
-  public String getAccessToken(final String user, final String endpointSetIdentifier) {
-    final TokenCacheKey tokenCacheKey
-            = new TokenCacheKey(user, TenantContextHolder.checkedGetIdentifier(), endpointSetIdentifier);
+  @SuppressWarnings("WeakerAccess")
+  public String getAccessToken(final String user, final String tenant) {
+    return getAccessToken(user, tenant, null);
+  }
+
+  public String getAccessToken(final String user, final String tenant, final @Nullable String endpointSetIdentifier) {
+    final TokenCacheKey tokenCacheKey = new TokenCacheKey(user, tenant, endpointSetIdentifier);
     final Authentication authentication = accessTokenCache.get(tokenCacheKey);
     return authentication.getAccessToken();
   }
 
   private Authentication createAccessToken(final TokenCacheKey tokenCacheKey) {
     final String refreshToken = refreshTokenCache.get(tokenCacheKey).getToken();
-    return identityManager.refresh(refreshToken);
+    try (final AutoTenantContext ignored = new AutoTenantContext(tokenCacheKey.getTenant())) {
+      return identityManager.refresh(refreshToken);
+    }
   }
 
   private TokenSerializationResult createRefreshToken(final TokenCacheKey tokenCacheKey) {
-    final Optional<RsaKeyPairFactory.KeyPairHolder> optionalSigningKeyPair
-            = tenantSignatureRepository.getLatestApplicationSigningKeyPair();
+    try (final AutoTenantContext ignored = new AutoTenantContext(tokenCacheKey.getTenant())) {
+      final Optional<RsaKeyPairFactory.KeyPairHolder> optionalSigningKeyPair
+              = tenantSignatureRepository.getLatestApplicationSigningKeyPair();
+
+      final RsaKeyPairFactory.KeyPairHolder signingKeyPair = optionalSigningKeyPair.orElseThrow(AmitAuthenticationException::missingTenant);
 
-    final RsaKeyPairFactory.KeyPairHolder signingKeyPair = optionalSigningKeyPair.orElseThrow(AmitAuthenticationException::missingTenant);
+      final TenantRefreshTokenSerializer.Specification specification = new TenantRefreshTokenSerializer.Specification()
+              .setSourceApplication(applicationName)
+              .setUser(tokenCacheKey.getUser())
+              .setSecondsToLive(REFRESH_TOKEN_LIFESPAN)
+              .setPrivateKey(signingKeyPair.privateKey())
+              .setKeyTimestamp(signingKeyPair.getTimestamp());
 
-    final TenantRefreshTokenSerializer.Specification specification = new TenantRefreshTokenSerializer.Specification()
-            .setSourceApplication(applicationName)
-            .setUser(tokenCacheKey.user)
-            .setSecondsToLive(REFRESH_TOKEN_LIFESPAN)
-            .setPrivateKey(signingKeyPair.privateKey())
-            .setKeyTimestamp(signingKeyPair.getTimestamp())
-            .setEndpointSet(tokenCacheKey.endpointSet);
+      tokenCacheKey.getEndpointSet().ifPresent(specification::setEndpointSet);
 
-    return tenantRefreshTokenSerializer.build(specification);
+      return tenantRefreshTokenSerializer.build(specification);
+    }
   }
 }
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/TokenCacheKey.java b/library/src/main/java/io/mifos/permittedfeignclient/service/TokenCacheKey.java
new file mode 100644
index 0000000..1d203c6
--- /dev/null
+++ b/library/src/main/java/io/mifos/permittedfeignclient/service/TokenCacheKey.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.service;
+
+import javax.annotation.Nullable;
+import java.util.Objects;
+import java.util.Optional;
+
+/**
+ * @author Myrle Krantz
+ */
+class TokenCacheKey {
+  private final String user;
+  private final String tenant;
+  @SuppressWarnings("OptionalUsedAsFieldOrParameterType")
+  private final Optional<String> endpointSet;
+
+  TokenCacheKey(final String user, final String tenant, final @Nullable String endpointSet) {
+    this.user = user;
+    this.tenant = tenant;
+    this.endpointSet = Optional.ofNullable(endpointSet);
+  }
+
+  String getUser() {
+    return user;
+  }
+
+  String getTenant() {
+    return tenant;
+  }
+
+  Optional<String> getEndpointSet() {
+    return endpointSet;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+    TokenCacheKey that = (TokenCacheKey) o;
+    return Objects.equals(user, that.user) &&
+            Objects.equals(tenant, that.tenant) &&
+            Objects.equals(endpointSet, that.endpointSet);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(user, tenant, endpointSet);
+  }
+
+  @Override
+  public String toString() {
+    return "TokenCacheKey{" +
+            "user='" + user + '\'' +
+            ", tenant='" + tenant + '\'' +
+            ", endpointSet='" + endpointSet + '\'' +
+            '}';
+  }
+}
diff --git a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
index 51d3f63..29017b6 100644
--- a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
+++ b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package io.mifos.permittedfeignclient.service;
 
 import io.mifos.anubis.config.TenantSignatureRepository;
@@ -5,6 +20,7 @@ import io.mifos.anubis.token.TenantRefreshTokenSerializer;
 import io.mifos.anubis.token.TokenSerializationResult;
 import io.mifos.core.lang.ApplicationName;
 import io.mifos.core.lang.AutoTenantContext;
+import io.mifos.core.lang.TenantContextHolder;
 import io.mifos.core.lang.security.RsaKeyPairFactory;
 import io.mifos.identity.api.v1.client.IdentityManager;
 import io.mifos.identity.api.v1.domain.Authentication;
@@ -48,10 +64,13 @@ public class ApplicationAccessTokenServiceTest {
             tenantRefreshTokenSerializerMock);
 
     try (final AutoTenantContext ignored1 = new AutoTenantContext(TENANT_NAME)) {
-      final String accessToken = testSubject.getAccessToken(USER_NAME, "blah");
+      final String accessTokenWithoutCallEndpointSet = testSubject.getAccessToken(USER_NAME, TenantContextHolder.checkedGetIdentifier());
+      Assert.assertEquals(BEARER_TOKEN_MOCK, accessTokenWithoutCallEndpointSet);
+
+      final String accessToken = testSubject.getAccessToken(USER_NAME, TenantContextHolder.checkedGetIdentifier(), "blah");
       Assert.assertEquals(BEARER_TOKEN_MOCK, accessToken);
 
-      final String accessTokenAgain = testSubject.getAccessToken(USER_NAME, "blah");
+      final String accessTokenAgain = testSubject.getAccessToken(USER_NAME, TenantContextHolder.checkedGetIdentifier(), "blah");
       Assert.assertEquals(BEARER_TOKEN_MOCK, accessTokenAgain);
     }
   }


[fineract-cn-permitted-feign-client] 05/27: Identity acquired now via feign builder instead of autowiring because pulling in configuration via @FeignClient causes it to be used for *all* the feign clients.

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit f7b8d32c9e677e3f7a68fff3611bb107ead67268
Author: myrle-krantz <mk...@mifos.org>
AuthorDate: Mon May 22 16:34:32 2017 +0200

    Identity acquired now via feign builder instead of autowiring because pulling in configuration via @FeignClient causes it to be used for *all* the feign clients.
---
 ...entConfiguration.java => LibraryConstants.java} | 12 ++------
 .../config/PermittedFeignClientConfiguration.java  | 36 +++++++++++++++++++++-
 2 files changed, 38 insertions(+), 10 deletions(-)

diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java b/library/src/main/java/io/mifos/permittedfeignclient/LibraryConstants.java
similarity index 63%
copy from library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
copy to library/src/main/java/io/mifos/permittedfeignclient/LibraryConstants.java
index b37a43b..f9e4493 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/LibraryConstants.java
@@ -13,17 +13,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package io.mifos.permittedfeignclient.config;
-
-import io.mifos.anubis.config.EnableAnubis;
-import org.springframework.cloud.netflix.feign.EnableFeignClients;
-import org.springframework.context.annotation.Configuration;
+package io.mifos.permittedfeignclient;
 
 /**
  * @author Myrle Krantz
  */
-@EnableAnubis
-@EnableFeignClients(basePackages = {"io.mifos.identity.api.v1"})
-@Configuration
-public class PermittedFeignClientConfiguration {
+public interface LibraryConstants {
+  String LOGGER_NAME = "permitted-feign-client-logger";
 }
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
index b37a43b..2e3f442 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
@@ -15,15 +15,49 @@
  */
 package io.mifos.permittedfeignclient.config;
 
+import feign.Client;
+import feign.Feign;
+import feign.gson.GsonDecoder;
+import feign.gson.GsonEncoder;
 import io.mifos.anubis.config.EnableAnubis;
+import io.mifos.core.api.util.AnnotatedErrorDecoder;
+import io.mifos.core.api.util.TenantedTargetInterceptor;
+import io.mifos.core.api.util.TokenedTargetInterceptor;
+import io.mifos.identity.api.v1.client.IdentityManager;
+import io.mifos.permittedfeignclient.LibraryConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.cloud.netflix.feign.EnableFeignClients;
+import org.springframework.cloud.netflix.feign.support.SpringMvcContract;
+import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
+import javax.annotation.Nonnull;
+
 /**
  * @author Myrle Krantz
  */
 @EnableAnubis
-@EnableFeignClients(basePackages = {"io.mifos.identity.api.v1"})
 @Configuration
 public class PermittedFeignClientConfiguration {
+  @Bean(name = LibraryConstants.LOGGER_NAME)
+  public Logger logger() {
+    return LoggerFactory.getLogger(LibraryConstants.LOGGER_NAME);
+  }
+
+  @Bean
+  public IdentityManager identityManager(
+          final @Nonnull Client feignClient,
+          final @Qualifier(LibraryConstants.LOGGER_NAME) @Nonnull Logger logger) {
+    return Feign.builder()
+            .contract(new SpringMvcContract())
+            .client(feignClient) //Integrates to ribbon.
+            .errorDecoder(new AnnotatedErrorDecoder(logger, IdentityManager.class))
+            .requestInterceptor(new TenantedTargetInterceptor())
+            .requestInterceptor(new TokenedTargetInterceptor())
+            .decoder(new GsonDecoder())
+            .encoder(new GsonEncoder())
+            .target(IdentityManager.class, "https://identity-v1");
+  }
 }


[fineract-cn-permitted-feign-client] 23/27: Removing last references to mifos.

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 507e9eccde8d75260f02ca66870e201e31c3e558
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Fri Apr 13 12:36:47 2018 +0200

    Removing last references to mifos.
---
 README.md | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 6df960f..ef1e068 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,6 @@
 # Apache Fineract CN Permitted Feign Client Library
 
-[![Join the chat at https://gitter.im/mifos-initiative/mifos.io](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mifos-initiative/mifos.io?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-
-This project provides secured access to other microservices via Feign. For this it uses anubis and identity to provide refresh and access tokens transparently.
+This project provides secured access to other services via Feign. For this it uses anubis and identity to provide refresh and access tokens transparently.
 
 ## Abstract
 Apache Fineract CN is an application framework for digital financial services, a system to support nationwide and cross-national financial transactions and help to level and speed the creation of an inclusive, interconnected digital economy for every nation in the world.


[fineract-cn-permitted-feign-client] 10/27: Improved logging and error handling. Fixed path to identity.

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 1f9140be84723b4a208d27045493784305cb8bca
Author: myrle-krantz <mk...@mifos.org>
AuthorDate: Wed Jun 7 12:08:12 2017 +0200

    Improved logging and error handling.  Fixed path to identity.
---
 .../config/PermittedFeignClientConfiguration.java        |  2 +-
 .../security/ApplicationTokenedTargetInterceptor.java    |  5 ++++-
 .../service/ApplicationAccessTokenService.java           | 16 ++++++++++++++--
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
index 41ff160..c004aae 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
@@ -57,6 +57,6 @@ public class PermittedFeignClientConfiguration {
             .requestInterceptor(new TokenedTargetInterceptor())
             .decoder(new GsonDecoder())
             .encoder(new GsonEncoder())
-            .target(IdentityManager.class, "http://identity-v1");
+            .target(IdentityManager.class, "http://identity-v1/identity/v1");
   }
 }
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java b/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
index 60a58ad..ecce505 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
@@ -48,8 +48,11 @@ public class ApplicationTokenedTargetInterceptor implements RequestInterceptor {
   @Override
   public void apply(final RequestTemplate template) {
     UserContextHolder.getUserContext().ifPresent(userContext -> {
+      final String accessToken = applicationAccessTokenService.getAccessToken(userContext.getUser(),
+              TenantContextHolder.checkedGetIdentifier(), endpointSetIdentifier);
+
       template.header(ApiConstants.USER_HEADER, userContext.getUser());
-      template.header(ApiConstants.AUTHORIZATION_HEADER, applicationAccessTokenService.getAccessToken(userContext.getUser(), TenantContextHolder.checkedGetIdentifier(), endpointSetIdentifier));
+      template.header(ApiConstants.AUTHORIZATION_HEADER, accessToken);
     });
   }
 }
\ No newline at end of file
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
index ca6e274..1cb4554 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
@@ -19,6 +19,8 @@ import io.mifos.anubis.config.TenantSignatureRepository;
 import io.mifos.anubis.security.AmitAuthenticationException;
 import io.mifos.anubis.token.TenantRefreshTokenSerializer;
 import io.mifos.anubis.token.TokenSerializationResult;
+import io.mifos.core.api.context.AutoGuest;
+import io.mifos.core.api.util.NotFoundException;
 import io.mifos.core.lang.ApplicationName;
 import io.mifos.core.lang.AutoTenantContext;
 import io.mifos.core.lang.security.RsaKeyPairFactory;
@@ -97,8 +99,14 @@ public class ApplicationAccessTokenService {
   private Authentication createAccessToken(final TokenCacheKey tokenCacheKey) {
     final String refreshToken = refreshTokenCache.get(tokenCacheKey).getToken();
     try (final AutoTenantContext ignored = new AutoTenantContext(tokenCacheKey.getTenant())) {
-      logger.debug("Getting access token for {}", tokenCacheKey);
-      return identityManager.refresh(refreshToken);
+      try (final AutoGuest ignored2 = new AutoGuest()) {
+        logger.debug("Getting access token for {}", tokenCacheKey);
+        return identityManager.refresh(refreshToken);
+      }
+      catch (final Exception e) {
+        logger.error("Couldn't get access token from identity for {}.", tokenCacheKey, e);
+        throw new NotFoundException("Couldn't get access token");
+      }
     }
   }
 
@@ -122,5 +130,9 @@ public class ApplicationAccessTokenService {
 
       return tenantRefreshTokenSerializer.build(specification);
     }
+    catch (final Exception e) {
+      logger.error("Couldn't create refresh token for {}.", tokenCacheKey, e);
+      throw new NotFoundException("Couldn't create refresh token.");
+    }
   }
 }


[fineract-cn-permitted-feign-client] 13/27: Merge pull request #1 from markusgeiss/develop

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 5dae48798f97d52833de59a241ef2ecce9abdbc7
Merge: 3b9e910 6b8d1e5
Author: Markus Geiss <ma...@kuelap.io>
AuthorDate: Wed Sep 27 07:43:24 2017 +0200

    Merge pull request #1 from markusgeiss/develop
    
    using EmptyBodyInterceptor to configure the client

 .../permittedfeignclient/config/PermittedFeignClientConfiguration.java  | 2 ++
 1 file changed, 2 insertions(+)


[fineract-cn-permitted-feign-client] 03/27: Merge pull request #1 from myrle-krantz/develop

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit ddf2c4238cf45b2248845e7786a2a65b329e7fa6
Merge: 44a4105 dbfd925
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Fri May 19 13:57:51 2017 +0200

    Merge pull request #1 from myrle-krantz/develop
    
    Making getAccessToken more useful for rhythm by making user an explic…

 .../security/ApplicationTokenedTargetInterceptor.java        |  9 ++++-----
 .../service/ApplicationAccessTokenService.java               |  5 ++---
 .../service/ApplicationAccessTokenServiceTest.java           | 12 ++++--------
 3 files changed, 10 insertions(+), 16 deletions(-)


[fineract-cn-permitted-feign-client] 08/27: Adding logging.

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit b2ee0d327ac184af67f550658c6b4228f00cc4a4
Author: myrle-krantz <mk...@mifos.org>
AuthorDate: Wed May 31 17:12:43 2017 +0200

    Adding logging.
---
 .../service/ApplicationAccessTokenService.java               | 12 +++++++++++-
 .../service/ApplicationAccessTokenServiceTest.java           |  6 +++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
index c21752b..ca6e274 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
@@ -24,9 +24,12 @@ import io.mifos.core.lang.AutoTenantContext;
 import io.mifos.core.lang.security.RsaKeyPairFactory;
 import io.mifos.identity.api.v1.client.IdentityManager;
 import io.mifos.identity.api.v1.domain.Authentication;
+import io.mifos.permittedfeignclient.LibraryConstants;
 import net.jodah.expiringmap.ExpirationPolicy;
 import net.jodah.expiringmap.ExpiringMap;
+import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Nonnull;
@@ -46,6 +49,7 @@ public class ApplicationAccessTokenService {
   private final TenantSignatureRepository tenantSignatureRepository;
   private final IdentityManager identityManager;
   private final TenantRefreshTokenSerializer tenantRefreshTokenSerializer;
+  private final Logger logger;
 
   private final Map<TokenCacheKey, TokenSerializationResult> refreshTokenCache;
   private final Map<TokenCacheKey, Authentication> accessTokenCache;
@@ -55,12 +59,15 @@ public class ApplicationAccessTokenService {
           final @Nonnull ApplicationName applicationName,
           final @Nonnull TenantSignatureRepository tenantSignatureRepository,
           final @Nonnull IdentityManager identityManager,
-          final @Nonnull TenantRefreshTokenSerializer tenantRefreshTokenSerializer) {
+          final @Nonnull TenantRefreshTokenSerializer tenantRefreshTokenSerializer,
+          @Qualifier(LibraryConstants.LOGGER_NAME) final @Nonnull Logger logger
+  ) {
 
     this.applicationName = applicationName.toString();
     this.tenantSignatureRepository = tenantSignatureRepository;
     this.identityManager = identityManager;
     this.tenantRefreshTokenSerializer = tenantRefreshTokenSerializer;
+    this.logger = logger;
 
     this.refreshTokenCache = ExpiringMap.builder()
             .maxSize(300)
@@ -90,12 +97,15 @@ public class ApplicationAccessTokenService {
   private Authentication createAccessToken(final TokenCacheKey tokenCacheKey) {
     final String refreshToken = refreshTokenCache.get(tokenCacheKey).getToken();
     try (final AutoTenantContext ignored = new AutoTenantContext(tokenCacheKey.getTenant())) {
+      logger.debug("Getting access token for {}", tokenCacheKey);
       return identityManager.refresh(refreshToken);
     }
   }
 
   private TokenSerializationResult createRefreshToken(final TokenCacheKey tokenCacheKey) {
     try (final AutoTenantContext ignored = new AutoTenantContext(tokenCacheKey.getTenant())) {
+      logger.debug("Creating refresh token for {}", tokenCacheKey);
+
       final Optional<RsaKeyPairFactory.KeyPairHolder> optionalSigningKeyPair
               = tenantSignatureRepository.getLatestApplicationSigningKeyPair();
 
diff --git a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
index 29017b6..6b366d3 100644
--- a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
+++ b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
@@ -27,6 +27,7 @@ import io.mifos.identity.api.v1.domain.Authentication;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
+import org.slf4j.Logger;
 
 import java.time.LocalDateTime;
 import java.util.Optional;
@@ -57,11 +58,14 @@ public class ApplicationAccessTokenServiceTest {
     Mockito.when(tenantRefreshTokenSerializerMock.build(Mockito.anyObject()))
             .thenReturn(new TokenSerializationResult(BEARER_TOKEN_MOCK, LocalDateTime.now()));
 
+    final Logger loggerMock = Mockito.mock(Logger.class);
+
     final ApplicationAccessTokenService testSubject = new ApplicationAccessTokenService(
             applicationNameMock,
             tenantSignatureRepositoryMock,
             identityManagerMock,
-            tenantRefreshTokenSerializerMock);
+            tenantRefreshTokenSerializerMock,
+            loggerMock);
 
     try (final AutoTenantContext ignored1 = new AutoTenantContext(TENANT_NAME)) {
       final String accessTokenWithoutCallEndpointSet = testSubject.getAccessToken(USER_NAME, TenantContextHolder.checkedGetIdentifier());


[fineract-cn-permitted-feign-client] 11/27: Merge pull request #3 from myrle-krantz/develop

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 3b9e91003fa657297c8d94cadfc3a4bb5528a11e
Merge: 8e02dee 1f9140b
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Thu Jun 8 18:23:05 2017 +0200

    Merge pull request #3 from myrle-krantz/develop
    
    Fine-tuning based on what I've learned from using this in integration test.

 .../config/PermittedFeignClientConfiguration.java  |  5 ++---
 .../ApplicationTokenedTargetInterceptor.java       |  5 ++++-
 .../service/ApplicationAccessTokenService.java     | 26 ++++++++++++++++++++--
 .../service/ApplicationAccessTokenServiceTest.java |  6 ++++-
 4 files changed, 35 insertions(+), 7 deletions(-)


[fineract-cn-permitted-feign-client] 18/27: Merge pull request #2 from Izakey/develop

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit e7721bfaa0f75dd097f80843ac3fd2b68d942793
Merge: 28e8752 1ea6c92
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Fri Mar 16 11:58:45 2018 +0100

    Merge pull request #2 from Izakey/develop
    
    Updated copyright information on permitted-feign-client

 HEADER                                             | 25 +++++++++++--------
 NOTICE.txt                                         |  5 ++++
 README.md                                          |  4 +--
 .../main/java/io/mifos/another/api/Another.java    | 25 +++++++++++--------
 .../another/service/AnotherConfiguration.java      | 25 +++++++++++--------
 .../another/service/AnotherRestController.java     | 25 +++++++++++--------
 another-for-test/src/main/resources/logback.xml    | 29 ++++++++++++----------
 .../client/ApplicationPermissionRequirements.java  | 25 +++++++++++--------
 .../api/v1/domain/ApplicationPermission.java       | 25 +++++++++++--------
 .../src/main/java/TestAccessAnother.java           | 25 +++++++++++--------
 .../main/java/accessanother/api/AccessAnother.java | 25 +++++++++++--------
 .../service/AccessAnotherConfiguration.java        | 25 +++++++++++--------
 .../service/AccessAnotherRestController.java       | 25 +++++++++++--------
 .../AnotherWithApplicationPermissions.java         | 25 +++++++++++--------
 .../permittedfeignclient/LibraryConstants.java     | 25 +++++++++++--------
 .../annotation/EndpointSet.java                    | 25 +++++++++++--------
 .../PermittedFeignClientsConfiguration.java        | 25 +++++++++++--------
 .../EnablePermissionRequestingFeignClient.java     | 25 +++++++++++--------
 ...ermittedFeignClientBeanDefinitionRegistrar.java | 25 +++++++++++--------
 .../config/PermittedFeignClientConfiguration.java  | 25 +++++++++++--------
 .../config/PermittedFeignClientImportSelector.java | 25 +++++++++++--------
 ...cationPermissionRequirementsRestController.java | 25 +++++++++++--------
 .../ApplicationTokenedTargetInterceptor.java       | 25 +++++++++++--------
 .../service/ApplicationAccessTokenService.java     | 25 +++++++++++--------
 .../ApplicationPermissionRequirementsService.java  | 25 +++++++++++--------
 .../service/TokenCacheKey.java                     | 25 +++++++++++--------
 .../service/ApplicationAccessTokenServiceTest.java | 25 +++++++++++--------
 ...plicationPermissionRequirementsServiceTest.java | 25 +++++++++++--------
 shared.gradle                                      |  2 --
 29 files changed, 373 insertions(+), 292 deletions(-)


[fineract-cn-permitted-feign-client] 02/27: Making getAccessToken more useful for rhythm by making user an explicit parameter rather than a thread local.

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit dbfd9257d6a7b4691cb0f7f128f0dce1ca2ab820
Author: myrle-krantz <mk...@mifos.org>
AuthorDate: Fri May 19 13:36:47 2017 +0200

    Making getAccessToken more useful for rhythm by making user an explicit parameter rather than a thread local.
---
 .../security/ApplicationTokenedTargetInterceptor.java        |  9 ++++-----
 .../service/ApplicationAccessTokenService.java               |  5 ++---
 .../service/ApplicationAccessTokenServiceTest.java           | 12 ++++--------
 3 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java b/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
index 2f3c7e7..4141d70 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
@@ -18,7 +18,6 @@ package io.mifos.permittedfeignclient.security;
 import feign.RequestInterceptor;
 import feign.RequestTemplate;
 import io.mifos.core.api.util.ApiConstants;
-import io.mifos.core.api.util.UserContext;
 import io.mifos.core.api.util.UserContextHolder;
 import io.mifos.permittedfeignclient.annotation.EndpointSet;
 import io.mifos.permittedfeignclient.service.ApplicationAccessTokenService;
@@ -47,9 +46,9 @@ public class ApplicationTokenedTargetInterceptor implements RequestInterceptor {
 
   @Override
   public void apply(final RequestTemplate template) {
-    template.header(ApiConstants.AUTHORIZATION_HEADER, applicationAccessTokenService.getAccessToken(endpointSetIdentifier));
-    UserContextHolder.getUserContext()
-            .map(UserContext::getUser)
-            .ifPresent(user -> template.header(ApiConstants.USER_HEADER, user));
+    UserContextHolder.getUserContext().ifPresent(userContext -> {
+      template.header(ApiConstants.USER_HEADER, userContext.getUser());
+      template.header(ApiConstants.AUTHORIZATION_HEADER, applicationAccessTokenService.getAccessToken(userContext.getUser(), endpointSetIdentifier));
+    });
   }
 }
\ No newline at end of file
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
index b97b4dd..082f5ec 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
@@ -19,7 +19,6 @@ import io.mifos.anubis.config.TenantSignatureRepository;
 import io.mifos.anubis.security.AmitAuthenticationException;
 import io.mifos.anubis.token.TenantRefreshTokenSerializer;
 import io.mifos.anubis.token.TokenSerializationResult;
-import io.mifos.core.api.util.UserContextHolder;
 import io.mifos.core.lang.ApplicationName;
 import io.mifos.core.lang.TenantContextHolder;
 import io.mifos.core.lang.security.RsaKeyPairFactory;
@@ -112,9 +111,9 @@ public class ApplicationAccessTokenService {
             .build();
   }
 
-  public String getAccessToken(final String endpointSetIdentifier) {
+  public String getAccessToken(final String user, final String endpointSetIdentifier) {
     final TokenCacheKey tokenCacheKey
-            = new TokenCacheKey(UserContextHolder.checkedGetUser(), TenantContextHolder.checkedGetIdentifier(), endpointSetIdentifier);
+            = new TokenCacheKey(user, TenantContextHolder.checkedGetIdentifier(), endpointSetIdentifier);
     final Authentication authentication = accessTokenCache.get(tokenCacheKey);
     return authentication.getAccessToken();
   }
diff --git a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
index c940668..51d3f63 100644
--- a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
+++ b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
@@ -3,7 +3,6 @@ package io.mifos.permittedfeignclient.service;
 import io.mifos.anubis.config.TenantSignatureRepository;
 import io.mifos.anubis.token.TenantRefreshTokenSerializer;
 import io.mifos.anubis.token.TokenSerializationResult;
-import io.mifos.core.api.context.AutoUserContext;
 import io.mifos.core.lang.ApplicationName;
 import io.mifos.core.lang.AutoTenantContext;
 import io.mifos.core.lang.security.RsaKeyPairFactory;
@@ -24,7 +23,6 @@ public class ApplicationAccessTokenServiceTest {
   private static final String BEARER_TOKEN_MOCK = "bearer token mock";
   private static final String USER_NAME = "user";
   private static final String TENANT_NAME = "tenant";
-  private static final String BEARER_INCOMING_ACCESS_TOKEN_MOCK = "bearer incoming access token mock";
 
   @Test
   public void testHappyCase() {
@@ -50,13 +48,11 @@ public class ApplicationAccessTokenServiceTest {
             tenantRefreshTokenSerializerMock);
 
     try (final AutoTenantContext ignored1 = new AutoTenantContext(TENANT_NAME)) {
-      try (final AutoUserContext ignored2 = new AutoUserContext(USER_NAME, BEARER_INCOMING_ACCESS_TOKEN_MOCK)) {
-        final String accessToken = testSubject.getAccessToken("blah");
-        Assert.assertEquals(BEARER_TOKEN_MOCK, accessToken);
+      final String accessToken = testSubject.getAccessToken(USER_NAME, "blah");
+      Assert.assertEquals(BEARER_TOKEN_MOCK, accessToken);
 
-        final String accessTokenAgain = testSubject.getAccessToken("blah");
-        Assert.assertEquals(BEARER_TOKEN_MOCK, accessTokenAgain);
-      }
+      final String accessTokenAgain = testSubject.getAccessToken(USER_NAME, "blah");
+      Assert.assertEquals(BEARER_TOKEN_MOCK, accessTokenAgain);
     }
   }
 }
\ No newline at end of file


[fineract-cn-permitted-feign-client] 17/27: Removed unused year and name variables

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 1ea6c924ed27d06ecbbf82c7e9a9c49d8e5a830f
Author: Isaac Kamga <u2...@gmail.com>
AuthorDate: Mon Mar 5 20:56:02 2018 +0100

    Removed unused year and name variables
---
 shared.gradle | 2 --
 1 file changed, 2 deletions(-)

diff --git a/shared.gradle b/shared.gradle
index 78aaecf..c7a6d95 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -72,8 +72,6 @@ license {
         yml = 'SCRIPT_STYLE'
         yaml = 'SCRIPT_STYLE'
     }
-    ext.year = Calendar.getInstance().get(Calendar.YEAR)
-    ext.name = 'The Apache Software Foundation'
 }
 
 task ci(dependsOn: ['clean', 'test', 'publish'])


[fineract-cn-permitted-feign-client] 21/27: Adjusting to package name changes in upstream repositories.

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 418e916363249554d0dd963e5d28598a9a380007
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Fri Apr 13 12:17:08 2018 +0200

    Adjusting to package name changes in upstream repositories.
---
 .../main/java/io/mifos/another/api/Another.java    |  4 +-
 .../another/service/AnotherConfiguration.java      |  8 +--
 .../another/service/AnotherRestController.java     |  4 +-
 .../api/v1/domain/ApplicationPermission.java       |  7 ++-
 .../src/main/java/TestAccessAnother.java           | 58 ++++++++++++----------
 .../main/java/accessanother/api/AccessAnother.java |  4 +-
 .../service/AccessAnotherConfiguration.java        |  6 +--
 .../service/AccessAnotherRestController.java       |  2 +-
 .../AnotherWithApplicationPermissions.java         |  2 +-
 .../PermittedFeignClientsConfiguration.java        |  8 +--
 .../config/PermittedFeignClientConfiguration.java  | 15 +++---
 ...cationPermissionRequirementsRestController.java | 10 ++--
 .../ApplicationTokenedTargetInterceptor.java       |  9 ++--
 .../service/ApplicationAccessTokenService.java     | 33 ++++++------
 .../ApplicationPermissionRequirementsService.java  |  8 +--
 .../service/ApplicationAccessTokenServiceTest.java | 21 ++++----
 ...plicationPermissionRequirementsServiceTest.java | 15 +++---
 17 files changed, 107 insertions(+), 107 deletions(-)

diff --git a/another-for-test/src/main/java/io/mifos/another/api/Another.java b/another-for-test/src/main/java/io/mifos/another/api/Another.java
index a9678b2..2e88318 100644
--- a/another-for-test/src/main/java/io/mifos/another/api/Another.java
+++ b/another-for-test/src/main/java/io/mifos/another/api/Another.java
@@ -18,8 +18,8 @@
  */
 package io.mifos.another.api;
 
-import io.mifos.anubis.api.v1.client.Anubis;
-import io.mifos.core.api.util.CustomFeignClientsConfiguration;
+import org.apache.fineract.cn.anubis.api.v1.client.Anubis;
+import org.apache.fineract.cn.api.util.CustomFeignClientsConfiguration;
 import org.springframework.cloud.netflix.feign.FeignClient;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.RequestMapping;
diff --git a/another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java b/another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java
index 7802696..053b5db 100644
--- a/another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java
+++ b/another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java
@@ -18,10 +18,10 @@
  */
 package io.mifos.another.service;
 
-import io.mifos.anubis.config.EnableAnubis;
-import io.mifos.core.lang.config.EnableApplicationName;
-import io.mifos.core.lang.config.EnableServiceException;
-import io.mifos.core.lang.config.EnableTenantContext;
+import org.apache.fineract.cn.anubis.config.EnableAnubis;
+import org.apache.fineract.cn.lang.config.EnableApplicationName;
+import org.apache.fineract.cn.lang.config.EnableServiceException;
+import org.apache.fineract.cn.lang.config.EnableTenantContext;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
diff --git a/another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java b/another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java
index 3397891..fc7d07c 100644
--- a/another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java
+++ b/another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java
@@ -18,8 +18,8 @@
  */
 package io.mifos.another.service;
 
-import io.mifos.anubis.annotation.AcceptedTokenType;
-import io.mifos.anubis.annotation.Permittable;
+import org.apache.fineract.cn.anubis.annotation.AcceptedTokenType;
+import org.apache.fineract.cn.anubis.annotation.Permittable;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
diff --git a/api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java b/api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java
index 9043811..7088aad 100644
--- a/api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java
+++ b/api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java
@@ -18,12 +18,11 @@
  */
 package io.mifos.permittedfeignclient.api.v1.domain;
 
-import io.mifos.core.lang.validation.constraints.ValidIdentifier;
-import io.mifos.identity.api.v1.domain.Permission;
-
+import java.util.Objects;
 import javax.annotation.Nullable;
 import javax.validation.Valid;
-import java.util.Objects;
+import org.apache.fineract.cn.identity.api.v1.domain.Permission;
+import org.apache.fineract.cn.lang.validation.constraints.ValidIdentifier;
 
 /**
  * @author Myrle Krantz
diff --git a/component-test/src/main/java/TestAccessAnother.java b/component-test/src/main/java/TestAccessAnother.java
index f086b42..a65727a 100644
--- a/component-test/src/main/java/TestAccessAnother.java
+++ b/component-test/src/main/java/TestAccessAnother.java
@@ -16,26 +16,42 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+import static accessanother.service.apiforother.AnotherWithApplicationPermissions.ENDPOINT_SET_IDENTIFIER;
+import static org.apache.fineract.cn.test.env.TestEnvironment.RIBBON_USES_EUREKA_PROPERTY;
+import static org.apache.fineract.cn.test.env.TestEnvironment.SPRING_CLOUD_DISCOVERY_ENABLED_PROPERTY;
+
 import accessanother.api.AccessAnother;
 import accessanother.service.AccessAnotherConfiguration;
 import io.mifos.another.api.Another;
-import io.mifos.anubis.api.v1.domain.AllowedOperation;
-import io.mifos.anubis.test.v1.TenantApplicationSecurityEnvironmentTestRule;
-import io.mifos.core.api.config.EnableApiFactory;
-import io.mifos.core.api.context.AutoUserContext;
-import io.mifos.core.api.util.ApiFactory;
-import io.mifos.core.lang.DateConverter;
-import io.mifos.core.test.env.TestEnvironment;
-import io.mifos.core.test.fixture.cassandra.CassandraInitializer;
-import io.mifos.core.test.servicestarter.EurekaForTest;
-import io.mifos.core.test.servicestarter.InitializedMicroservice;
-import io.mifos.core.test.servicestarter.IntegrationTestEnvironment;
-import io.mifos.identity.api.v1.client.IdentityManager;
-import io.mifos.identity.api.v1.domain.Authentication;
-import io.mifos.identity.api.v1.domain.Permission;
 import io.mifos.permittedfeignclient.api.v1.client.ApplicationPermissionRequirements;
 import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
-import org.junit.*;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import org.apache.fineract.cn.anubis.api.v1.domain.AllowedOperation;
+import org.apache.fineract.cn.anubis.test.v1.TenantApplicationSecurityEnvironmentTestRule;
+import org.apache.fineract.cn.api.config.EnableApiFactory;
+import org.apache.fineract.cn.api.context.AutoUserContext;
+import org.apache.fineract.cn.api.util.ApiFactory;
+import org.apache.fineract.cn.identity.api.v1.client.IdentityManager;
+import org.apache.fineract.cn.identity.api.v1.domain.Authentication;
+import org.apache.fineract.cn.identity.api.v1.domain.Permission;
+import org.apache.fineract.cn.lang.DateConverter;
+import org.apache.fineract.cn.test.env.TestEnvironment;
+import org.apache.fineract.cn.test.fixture.cassandra.CassandraInitializer;
+import org.apache.fineract.cn.test.servicestarter.EurekaForTest;
+import org.apache.fineract.cn.test.servicestarter.InitializedMicroservice;
+import org.apache.fineract.cn.test.servicestarter.IntegrationTestEnvironment;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TestRule;
 import org.junit.runner.RunWith;
@@ -50,18 +66,6 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Import;
 import org.springframework.test.context.junit4.SpringRunner;
 
-import java.time.LocalDateTime;
-import java.time.ZoneId;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-import static accessanother.service.apiforother.AnotherWithApplicationPermissions.ENDPOINT_SET_IDENTIFIER;
-import static io.mifos.core.test.env.TestEnvironment.RIBBON_USES_EUREKA_PROPERTY;
-import static io.mifos.core.test.env.TestEnvironment.SPRING_CLOUD_DISCOVERY_ENABLED_PROPERTY;
-
 /**
  * @author Myrle Krantz
  */
diff --git a/component-test/src/main/java/accessanother/api/AccessAnother.java b/component-test/src/main/java/accessanother/api/AccessAnother.java
index 4c1def7..b9717d8 100644
--- a/component-test/src/main/java/accessanother/api/AccessAnother.java
+++ b/component-test/src/main/java/accessanother/api/AccessAnother.java
@@ -18,8 +18,8 @@
  */
 package accessanother.api;
 
-import io.mifos.anubis.api.v1.client.Anubis;
-import io.mifos.core.api.util.CustomFeignClientsConfiguration;
+import org.apache.fineract.cn.anubis.api.v1.client.Anubis;
+import org.apache.fineract.cn.api.util.CustomFeignClientsConfiguration;
 import org.springframework.cloud.netflix.feign.FeignClient;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.RequestMapping;
diff --git a/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java b/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java
index 0f6d6a8..92cc905 100644
--- a/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java
+++ b/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java
@@ -19,10 +19,10 @@
 package accessanother.service;
 
 import accessanother.service.apiforother.AnotherWithApplicationPermissions;
-import io.mifos.anubis.config.EnableAnubis;
-import io.mifos.core.lang.config.EnableServiceException;
-import io.mifos.core.lang.config.EnableTenantContext;
 import io.mifos.permittedfeignclient.config.EnablePermissionRequestingFeignClient;
+import org.apache.fineract.cn.anubis.config.EnableAnubis;
+import org.apache.fineract.cn.lang.config.EnableServiceException;
+import org.apache.fineract.cn.lang.config.EnableTenantContext;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.netflix.feign.EnableFeignClients;
diff --git a/component-test/src/main/java/accessanother/service/AccessAnotherRestController.java b/component-test/src/main/java/accessanother/service/AccessAnotherRestController.java
index be6107b..eb16653 100644
--- a/component-test/src/main/java/accessanother/service/AccessAnotherRestController.java
+++ b/component-test/src/main/java/accessanother/service/AccessAnotherRestController.java
@@ -19,7 +19,7 @@
 package accessanother.service;
 
 import accessanother.service.apiforother.AnotherWithApplicationPermissions;
-import io.mifos.anubis.annotation.Permittable;
+import org.apache.fineract.cn.anubis.annotation.Permittable;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RequestMapping;
diff --git a/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java b/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java
index d30cdc0..3262122 100644
--- a/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java
+++ b/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java
@@ -18,9 +18,9 @@
  */
 package accessanother.service.apiforother;
 
-import io.mifos.anubis.annotation.Permittable;
 import io.mifos.permittedfeignclient.annotation.EndpointSet;
 import io.mifos.permittedfeignclient.annotation.PermittedFeignClientsConfiguration;
+import org.apache.fineract.cn.anubis.annotation.Permittable;
 import org.springframework.cloud.netflix.feign.FeignClient;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.RequestMapping;
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java b/library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java
index e8e86b9..aa7ee46 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java
@@ -18,16 +18,18 @@
  */
 package io.mifos.permittedfeignclient.annotation;
 
+import static org.apache.fineract.cn.api.config.ApiConfiguration.LOGGER_NAME;
+
 import feign.Feign;
 import feign.Target;
 import feign.codec.Decoder;
 import feign.codec.Encoder;
 import feign.gson.GsonDecoder;
 import feign.gson.GsonEncoder;
-import io.mifos.core.api.util.AnnotatedErrorDecoder;
-import io.mifos.core.api.util.TenantedTargetInterceptor;
 import io.mifos.permittedfeignclient.security.ApplicationTokenedTargetInterceptor;
 import io.mifos.permittedfeignclient.service.ApplicationAccessTokenService;
+import org.apache.fineract.cn.api.util.AnnotatedErrorDecoder;
+import org.apache.fineract.cn.api.util.TenantedTargetInterceptor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -36,8 +38,6 @@ import org.springframework.cloud.netflix.feign.FeignClientsConfiguration;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Scope;
 
-import static io.mifos.core.api.config.ApiConfiguration.LOGGER_NAME;
-
 /**
  * @author Myrle Krantz
  */
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
index 7bbed95..26636c6 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
@@ -22,13 +22,14 @@ import feign.Client;
 import feign.Feign;
 import feign.gson.GsonDecoder;
 import feign.gson.GsonEncoder;
-import io.mifos.anubis.config.EnableAnubis;
-import io.mifos.core.api.util.AnnotatedErrorDecoder;
-import io.mifos.core.api.util.EmptyBodyInterceptor;
-import io.mifos.core.api.util.TenantedTargetInterceptor;
-import io.mifos.core.api.util.TokenedTargetInterceptor;
-import io.mifos.identity.api.v1.client.IdentityManager;
 import io.mifos.permittedfeignclient.LibraryConstants;
+import javax.annotation.Nonnull;
+import org.apache.fineract.cn.anubis.config.EnableAnubis;
+import org.apache.fineract.cn.api.util.AnnotatedErrorDecoder;
+import org.apache.fineract.cn.api.util.EmptyBodyInterceptor;
+import org.apache.fineract.cn.api.util.TenantedTargetInterceptor;
+import org.apache.fineract.cn.api.util.TokenedTargetInterceptor;
+import org.apache.fineract.cn.identity.api.v1.client.IdentityManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -36,8 +37,6 @@ import org.springframework.cloud.netflix.feign.support.SpringMvcContract;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
-import javax.annotation.Nonnull;
-
 /**
  * @author Myrle Krantz
  */
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java b/library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java
index a21f719..e9c97df 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java
@@ -18,10 +18,12 @@
  */
 package io.mifos.permittedfeignclient.controller;
 
-import io.mifos.anubis.annotation.AcceptedTokenType;
-import io.mifos.anubis.annotation.Permittable;
-import io.mifos.permittedfeignclient.service.ApplicationPermissionRequirementsService;
 import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
+import io.mifos.permittedfeignclient.service.ApplicationPermissionRequirementsService;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.fineract.cn.anubis.annotation.AcceptedTokenType;
+import org.apache.fineract.cn.anubis.annotation.Permittable;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
@@ -30,8 +32,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.*;
-
 /**
  * @author Myrle Krantz
  */
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java b/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
index 7165b2d..d4a785e 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
@@ -20,14 +20,13 @@ package io.mifos.permittedfeignclient.security;
 
 import feign.RequestInterceptor;
 import feign.RequestTemplate;
-import io.mifos.core.api.util.ApiConstants;
-import io.mifos.core.api.util.UserContextHolder;
-import io.mifos.core.lang.TenantContextHolder;
 import io.mifos.permittedfeignclient.annotation.EndpointSet;
 import io.mifos.permittedfeignclient.service.ApplicationAccessTokenService;
-import org.springframework.util.Assert;
-
 import javax.annotation.Nonnull;
+import org.apache.fineract.cn.api.util.ApiConstants;
+import org.apache.fineract.cn.api.util.UserContextHolder;
+import org.apache.fineract.cn.lang.TenantContextHolder;
+import org.springframework.util.Assert;
 
 /**
  * @author Myrle Krantz
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
index 2b1f2c0..d729af3 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
@@ -18,31 +18,30 @@
  */
 package io.mifos.permittedfeignclient.service;
 
-import io.mifos.anubis.config.TenantSignatureRepository;
-import io.mifos.anubis.security.AmitAuthenticationException;
-import io.mifos.anubis.token.TenantRefreshTokenSerializer;
-import io.mifos.anubis.token.TokenSerializationResult;
-import io.mifos.core.api.context.AutoGuest;
-import io.mifos.core.api.util.NotFoundException;
-import io.mifos.core.lang.ApplicationName;
-import io.mifos.core.lang.AutoTenantContext;
-import io.mifos.core.lang.security.RsaKeyPairFactory;
-import io.mifos.identity.api.v1.client.IdentityManager;
-import io.mifos.identity.api.v1.domain.Authentication;
 import io.mifos.permittedfeignclient.LibraryConstants;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 import net.jodah.expiringmap.ExpirationPolicy;
 import net.jodah.expiringmap.ExpiringMap;
+import org.apache.fineract.cn.anubis.config.TenantSignatureRepository;
+import org.apache.fineract.cn.anubis.security.AmitAuthenticationException;
+import org.apache.fineract.cn.anubis.token.TenantRefreshTokenSerializer;
+import org.apache.fineract.cn.anubis.token.TokenSerializationResult;
+import org.apache.fineract.cn.api.context.AutoGuest;
+import org.apache.fineract.cn.api.util.NotFoundException;
+import org.apache.fineract.cn.identity.api.v1.client.IdentityManager;
+import org.apache.fineract.cn.identity.api.v1.domain.Authentication;
+import org.apache.fineract.cn.lang.ApplicationName;
+import org.apache.fineract.cn.lang.AutoTenantContext;
+import org.apache.fineract.cn.lang.security.RsaKeyPairFactory;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import java.util.Map;
-import java.util.Optional;
-import java.util.concurrent.TimeUnit;
-
 /**
  * @author Myrle Krantz
  */
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java
index 278760b..77b7c3b 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java
+++ b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java
@@ -18,12 +18,12 @@
  */
 package io.mifos.permittedfeignclient.service;
 
-import io.mifos.anubis.annotation.Permittable;
-import io.mifos.anubis.annotation.Permittables;
-import io.mifos.anubis.api.v1.domain.AllowedOperation;
-import io.mifos.identity.api.v1.domain.Permission;
 import io.mifos.permittedfeignclient.annotation.EndpointSet;
 import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
+import org.apache.fineract.cn.anubis.annotation.Permittable;
+import org.apache.fineract.cn.anubis.annotation.Permittables;
+import org.apache.fineract.cn.anubis.api.v1.domain.AllowedOperation;
+import org.apache.fineract.cn.identity.api.v1.domain.Permission;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestMapping;
diff --git a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
index e898e16..74f3d68 100644
--- a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
+++ b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
@@ -18,15 +18,15 @@
  */
 package io.mifos.permittedfeignclient.service;
 
-import io.mifos.anubis.config.TenantSignatureRepository;
-import io.mifos.anubis.token.TenantRefreshTokenSerializer;
-import io.mifos.anubis.token.TokenSerializationResult;
-import io.mifos.core.lang.ApplicationName;
-import io.mifos.core.lang.AutoTenantContext;
-import io.mifos.core.lang.TenantContextHolder;
-import io.mifos.core.lang.security.RsaKeyPairFactory;
-import io.mifos.identity.api.v1.client.IdentityManager;
-import io.mifos.identity.api.v1.domain.Authentication;
+import org.apache.fineract.cn.anubis.config.TenantSignatureRepository;
+import org.apache.fineract.cn.anubis.token.TenantRefreshTokenSerializer;
+import org.apache.fineract.cn.anubis.token.TokenSerializationResult;
+import org.apache.fineract.cn.identity.api.v1.client.IdentityManager;
+import org.apache.fineract.cn.identity.api.v1.domain.Authentication;
+import org.apache.fineract.cn.lang.ApplicationName;
+import org.apache.fineract.cn.lang.AutoTenantContext;
+import org.apache.fineract.cn.lang.TenantContextHolder;
+import org.apache.fineract.cn.lang.security.RsaKeyPairFactory;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -71,7 +71,8 @@ public class ApplicationAccessTokenServiceTest {
             loggerMock);
 
     try (final AutoTenantContext ignored1 = new AutoTenantContext(TENANT_NAME)) {
-      final String accessTokenWithoutCallEndpointSet = testSubject.getAccessToken(USER_NAME, TenantContextHolder.checkedGetIdentifier());
+      final String accessTokenWithoutCallEndpointSet = testSubject.getAccessToken(USER_NAME, TenantContextHolder
+          .checkedGetIdentifier());
       Assert.assertEquals(BEARER_TOKEN_MOCK, accessTokenWithoutCallEndpointSet);
 
       final String accessToken = testSubject.getAccessToken(USER_NAME, TenantContextHolder.checkedGetIdentifier(), "blah");
diff --git a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java
index 7942319..52e1887 100644
--- a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java
+++ b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java
@@ -18,22 +18,21 @@
  */
 package io.mifos.permittedfeignclient.service;
 
-import io.mifos.anubis.annotation.Permittable;
-import io.mifos.anubis.api.v1.domain.AllowedOperation;
-import io.mifos.identity.api.v1.domain.Permission;
 import io.mifos.permittedfeignclient.annotation.EndpointSet;
 import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
+import java.util.Collections;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import org.apache.fineract.cn.anubis.annotation.Permittable;
+import org.apache.fineract.cn.anubis.api.v1.domain.AllowedOperation;
+import org.apache.fineract.cn.identity.api.v1.domain.Permission;
 import org.junit.Assert;
 import org.junit.Test;
 import org.springframework.cloud.netflix.feign.FeignClient;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
-import java.util.Collections;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
 /**
  * @author Myrle Krantz
  */


[fineract-cn-permitted-feign-client] 06/27: Merge branch 'develop' of https://github.com/mifosio/permitted-feign-client into develop

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 752218b11d46fb53f6d276862fca11dbbecf6baf
Merge: f7b8d32 ddf2c42
Author: myrle-krantz <mk...@mifos.org>
AuthorDate: Mon May 22 16:35:24 2017 +0200

    Merge branch 'develop' of https://github.com/mifosio/permitted-feign-client into develop



[fineract-cn-permitted-feign-client] 22/27: Change package names from mifos to apache fineract.

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit b5cf8f3d34c01e9a2b2fe7526bdf6f5b751185e1
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Fri Apr 13 12:36:01 2018 +0200

    Change package names from mifos to apache fineract.
---
 .../fineract/cn/permittedfeignclient}/another/api/Another.java      | 2 +-
 .../permittedfeignclient}/another/service/AnotherConfiguration.java | 4 ++--
 .../another/service/AnotherRestController.java                      | 2 +-
 .../api/v1/client/ApplicationPermissionRequirements.java            | 4 ++--
 .../permittedfeignclient/api/v1/domain/ApplicationPermission.java   | 2 +-
 component-test/src/main/java/TestAccessAnother.java                 | 6 +++---
 .../main/java/accessanother/service/AccessAnotherConfiguration.java | 2 +-
 .../service/apiforother/AnotherWithApplicationPermissions.java      | 4 ++--
 .../apache/fineract/cn}/permittedfeignclient/LibraryConstants.java  | 2 +-
 .../fineract/cn}/permittedfeignclient/annotation/EndpointSet.java   | 2 +-
 .../annotation/PermittedFeignClientsConfiguration.java              | 6 +++---
 .../config/EnablePermissionRequestingFeignClient.java               | 2 +-
 .../config/PermittedFeignClientBeanDefinitionRegistrar.java         | 4 ++--
 .../config/PermittedFeignClientConfiguration.java                   | 4 ++--
 .../config/PermittedFeignClientImportSelector.java                  | 6 +++---
 .../controller/ApplicationPermissionRequirementsRestController.java | 6 +++---
 .../security/ApplicationTokenedTargetInterceptor.java               | 6 +++---
 .../permittedfeignclient/service/ApplicationAccessTokenService.java | 4 ++--
 .../service/ApplicationPermissionRequirementsService.java           | 6 +++---
 .../fineract/cn}/permittedfeignclient/service/TokenCacheKey.java    | 2 +-
 .../service/ApplicationAccessTokenServiceTest.java                  | 2 +-
 .../service/ApplicationPermissionRequirementsServiceTest.java       | 6 +++---
 22 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/another-for-test/src/main/java/io/mifos/another/api/Another.java b/another-for-test/src/main/java/org/apache/fineract/cn/permittedfeignclient/another/api/Another.java
similarity index 96%
rename from another-for-test/src/main/java/io/mifos/another/api/Another.java
rename to another-for-test/src/main/java/org/apache/fineract/cn/permittedfeignclient/another/api/Another.java
index 2e88318..ed81420 100644
--- a/another-for-test/src/main/java/io/mifos/another/api/Another.java
+++ b/another-for-test/src/main/java/org/apache/fineract/cn/permittedfeignclient/another/api/Another.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.another.api;
+package org.apache.fineract.cn.permittedfeignclient.another.api;
 
 import org.apache.fineract.cn.anubis.api.v1.client.Anubis;
 import org.apache.fineract.cn.api.util.CustomFeignClientsConfiguration;
diff --git a/another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java b/another-for-test/src/main/java/org/apache/fineract/cn/permittedfeignclient/another/service/AnotherConfiguration.java
similarity index 93%
rename from another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java
rename to another-for-test/src/main/java/org/apache/fineract/cn/permittedfeignclient/another/service/AnotherConfiguration.java
index 053b5db..03e8e63 100644
--- a/another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java
+++ b/another-for-test/src/main/java/org/apache/fineract/cn/permittedfeignclient/another/service/AnotherConfiguration.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.another.service;
+package org.apache.fineract.cn.permittedfeignclient.another.service;
 
 import org.apache.fineract.cn.anubis.config.EnableAnubis;
 import org.apache.fineract.cn.lang.config.EnableApplicationName;
@@ -41,7 +41,7 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
 @EnableApplicationName
 @EnableServiceException
 @ComponentScan({
-        "io.mifos.another.service"
+        "org.apache.fineract.cn.permittedfeignclient.another.service"
 })
 public class AnotherConfiguration {
 
diff --git a/another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java b/another-for-test/src/main/java/org/apache/fineract/cn/permittedfeignclient/another/service/AnotherRestController.java
similarity index 96%
rename from another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java
rename to another-for-test/src/main/java/org/apache/fineract/cn/permittedfeignclient/another/service/AnotherRestController.java
index fc7d07c..db61744 100644
--- a/another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java
+++ b/another-for-test/src/main/java/org/apache/fineract/cn/permittedfeignclient/another/service/AnotherRestController.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.another.service;
+package org.apache.fineract.cn.permittedfeignclient.another.service;
 
 import org.apache.fineract.cn.anubis.annotation.AcceptedTokenType;
 import org.apache.fineract.cn.anubis.annotation.Permittable;
diff --git a/api/src/main/java/io/mifos/permittedfeignclient/api/v1/client/ApplicationPermissionRequirements.java b/api/src/main/java/org/apache/finearct/cn/permittedfeignclient/api/v1/client/ApplicationPermissionRequirements.java
similarity index 90%
rename from api/src/main/java/io/mifos/permittedfeignclient/api/v1/client/ApplicationPermissionRequirements.java
rename to api/src/main/java/org/apache/finearct/cn/permittedfeignclient/api/v1/client/ApplicationPermissionRequirements.java
index 746b34d..cdd4e0f 100644
--- a/api/src/main/java/io/mifos/permittedfeignclient/api/v1/client/ApplicationPermissionRequirements.java
+++ b/api/src/main/java/org/apache/finearct/cn/permittedfeignclient/api/v1/client/ApplicationPermissionRequirements.java
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.api.v1.client;
+package org.apache.finearct.cn.permittedfeignclient.api.v1.client;
 
-import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
+import org.apache.finearct.cn.permittedfeignclient.api.v1.domain.ApplicationPermission;
 import org.springframework.cloud.netflix.feign.FeignClient;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.RequestMapping;
diff --git a/api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java b/api/src/main/java/org/apache/finearct/cn/permittedfeignclient/api/v1/domain/ApplicationPermission.java
similarity index 97%
rename from api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java
rename to api/src/main/java/org/apache/finearct/cn/permittedfeignclient/api/v1/domain/ApplicationPermission.java
index 7088aad..8efa044 100644
--- a/api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java
+++ b/api/src/main/java/org/apache/finearct/cn/permittedfeignclient/api/v1/domain/ApplicationPermission.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.api.v1.domain;
+package org.apache.finearct.cn.permittedfeignclient.api.v1.domain;
 
 import java.util.Objects;
 import javax.annotation.Nullable;
diff --git a/component-test/src/main/java/TestAccessAnother.java b/component-test/src/main/java/TestAccessAnother.java
index a65727a..cdf9e73 100644
--- a/component-test/src/main/java/TestAccessAnother.java
+++ b/component-test/src/main/java/TestAccessAnother.java
@@ -22,9 +22,9 @@ import static org.apache.fineract.cn.test.env.TestEnvironment.SPRING_CLOUD_DISCO
 
 import accessanother.api.AccessAnother;
 import accessanother.service.AccessAnotherConfiguration;
-import io.mifos.another.api.Another;
-import io.mifos.permittedfeignclient.api.v1.client.ApplicationPermissionRequirements;
-import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
+import org.apache.fineract.cn.permittedfeignclient.another.api.Another;
+import org.apache.finearct.cn.permittedfeignclient.api.v1.client.ApplicationPermissionRequirements;
+import org.apache.finearct.cn.permittedfeignclient.api.v1.domain.ApplicationPermission;
 import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.util.Arrays;
diff --git a/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java b/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java
index 92cc905..6bd7090 100644
--- a/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java
+++ b/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java
@@ -19,7 +19,7 @@
 package accessanother.service;
 
 import accessanother.service.apiforother.AnotherWithApplicationPermissions;
-import io.mifos.permittedfeignclient.config.EnablePermissionRequestingFeignClient;
+import org.apache.fineract.cn.permittedfeignclient.config.EnablePermissionRequestingFeignClient;
 import org.apache.fineract.cn.anubis.config.EnableAnubis;
 import org.apache.fineract.cn.lang.config.EnableServiceException;
 import org.apache.fineract.cn.lang.config.EnableTenantContext;
diff --git a/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java b/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java
index 3262122..af3fd4c 100644
--- a/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java
+++ b/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java
@@ -18,8 +18,8 @@
  */
 package accessanother.service.apiforother;
 
-import io.mifos.permittedfeignclient.annotation.EndpointSet;
-import io.mifos.permittedfeignclient.annotation.PermittedFeignClientsConfiguration;
+import org.apache.fineract.cn.permittedfeignclient.annotation.EndpointSet;
+import org.apache.fineract.cn.permittedfeignclient.annotation.PermittedFeignClientsConfiguration;
 import org.apache.fineract.cn.anubis.annotation.Permittable;
 import org.springframework.cloud.netflix.feign.FeignClient;
 import org.springframework.http.MediaType;
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/LibraryConstants.java b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/LibraryConstants.java
similarity index 94%
rename from library/src/main/java/io/mifos/permittedfeignclient/LibraryConstants.java
rename to library/src/main/java/org/apache/fineract/cn/permittedfeignclient/LibraryConstants.java
index 0995411..f555c1a 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/LibraryConstants.java
+++ b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/LibraryConstants.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient;
+package org.apache.fineract.cn.permittedfeignclient;
 
 /**
  * @author Myrle Krantz
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/annotation/EndpointSet.java b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/annotation/EndpointSet.java
similarity index 94%
rename from library/src/main/java/io/mifos/permittedfeignclient/annotation/EndpointSet.java
rename to library/src/main/java/org/apache/fineract/cn/permittedfeignclient/annotation/EndpointSet.java
index 3f2ff7e..26d153d 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/annotation/EndpointSet.java
+++ b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/annotation/EndpointSet.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.annotation;
+package org.apache.fineract.cn.permittedfeignclient.annotation;
 
 import java.lang.annotation.*;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java
similarity index 92%
rename from library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java
rename to library/src/main/java/org/apache/fineract/cn/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java
index aa7ee46..b81df81 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java
+++ b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.annotation;
+package org.apache.fineract.cn.permittedfeignclient.annotation;
 
 import static org.apache.fineract.cn.api.config.ApiConfiguration.LOGGER_NAME;
 
@@ -26,8 +26,8 @@ import feign.codec.Decoder;
 import feign.codec.Encoder;
 import feign.gson.GsonDecoder;
 import feign.gson.GsonEncoder;
-import io.mifos.permittedfeignclient.security.ApplicationTokenedTargetInterceptor;
-import io.mifos.permittedfeignclient.service.ApplicationAccessTokenService;
+import org.apache.fineract.cn.permittedfeignclient.security.ApplicationTokenedTargetInterceptor;
+import org.apache.fineract.cn.permittedfeignclient.service.ApplicationAccessTokenService;
 import org.apache.fineract.cn.api.util.AnnotatedErrorDecoder;
 import org.apache.fineract.cn.api.util.TenantedTargetInterceptor;
 import org.slf4j.Logger;
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/EnablePermissionRequestingFeignClient.java b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/config/EnablePermissionRequestingFeignClient.java
similarity index 95%
rename from library/src/main/java/io/mifos/permittedfeignclient/config/EnablePermissionRequestingFeignClient.java
rename to library/src/main/java/org/apache/fineract/cn/permittedfeignclient/config/EnablePermissionRequestingFeignClient.java
index 294eb0c..231b856 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/EnablePermissionRequestingFeignClient.java
+++ b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/config/EnablePermissionRequestingFeignClient.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.config;
+package org.apache.fineract.cn.permittedfeignclient.config;
 
 import org.springframework.context.annotation.Import;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientBeanDefinitionRegistrar.java b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/config/PermittedFeignClientBeanDefinitionRegistrar.java
similarity index 92%
rename from library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientBeanDefinitionRegistrar.java
rename to library/src/main/java/org/apache/fineract/cn/permittedfeignclient/config/PermittedFeignClientBeanDefinitionRegistrar.java
index d83dfae..acad314 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientBeanDefinitionRegistrar.java
+++ b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/config/PermittedFeignClientBeanDefinitionRegistrar.java
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.config;
+package org.apache.fineract.cn.permittedfeignclient.config;
 
-import io.mifos.permittedfeignclient.service.ApplicationPermissionRequirementsService;
+import org.apache.fineract.cn.permittedfeignclient.service.ApplicationPermissionRequirementsService;
 import org.springframework.beans.factory.support.AbstractBeanDefinition;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 import org.springframework.beans.factory.support.BeanDefinitionRegistry;
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/config/PermittedFeignClientConfiguration.java
similarity index 95%
rename from library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
rename to library/src/main/java/org/apache/fineract/cn/permittedfeignclient/config/PermittedFeignClientConfiguration.java
index 26636c6..933fc15 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
+++ b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/config/PermittedFeignClientConfiguration.java
@@ -16,13 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.config;
+package org.apache.fineract.cn.permittedfeignclient.config;
 
 import feign.Client;
 import feign.Feign;
 import feign.gson.GsonDecoder;
 import feign.gson.GsonEncoder;
-import io.mifos.permittedfeignclient.LibraryConstants;
+import org.apache.fineract.cn.permittedfeignclient.LibraryConstants;
 import javax.annotation.Nonnull;
 import org.apache.fineract.cn.anubis.config.EnableAnubis;
 import org.apache.fineract.cn.api.util.AnnotatedErrorDecoder;
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientImportSelector.java b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/config/PermittedFeignClientImportSelector.java
similarity index 85%
rename from library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientImportSelector.java
rename to library/src/main/java/org/apache/fineract/cn/permittedfeignclient/config/PermittedFeignClientImportSelector.java
index e1469bd..8478bf4 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientImportSelector.java
+++ b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/config/PermittedFeignClientImportSelector.java
@@ -16,10 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.config;
+package org.apache.fineract.cn.permittedfeignclient.config;
 
-import io.mifos.permittedfeignclient.controller.ApplicationPermissionRequirementsRestController;
-import io.mifos.permittedfeignclient.service.ApplicationAccessTokenService;
+import org.apache.fineract.cn.permittedfeignclient.controller.ApplicationPermissionRequirementsRestController;
+import org.apache.fineract.cn.permittedfeignclient.service.ApplicationAccessTokenService;
 import org.springframework.context.annotation.ImportSelector;
 import org.springframework.core.type.AnnotationMetadata;
 
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java
similarity index 89%
rename from library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java
rename to library/src/main/java/org/apache/fineract/cn/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java
index e9c97df..b4f221b 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java
+++ b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java
@@ -16,10 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.controller;
+package org.apache.fineract.cn.permittedfeignclient.controller;
 
-import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
-import io.mifos.permittedfeignclient.service.ApplicationPermissionRequirementsService;
+import org.apache.finearct.cn.permittedfeignclient.api.v1.domain.ApplicationPermission;
+import org.apache.fineract.cn.permittedfeignclient.service.ApplicationPermissionRequirementsService;
 import java.util.ArrayList;
 import java.util.List;
 import org.apache.fineract.cn.anubis.annotation.AcceptedTokenType;
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
similarity index 91%
rename from library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
rename to library/src/main/java/org/apache/fineract/cn/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
index d4a785e..ff43286 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
+++ b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
@@ -16,12 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.security;
+package org.apache.fineract.cn.permittedfeignclient.security;
 
 import feign.RequestInterceptor;
 import feign.RequestTemplate;
-import io.mifos.permittedfeignclient.annotation.EndpointSet;
-import io.mifos.permittedfeignclient.service.ApplicationAccessTokenService;
+import org.apache.fineract.cn.permittedfeignclient.annotation.EndpointSet;
+import org.apache.fineract.cn.permittedfeignclient.service.ApplicationAccessTokenService;
 import javax.annotation.Nonnull;
 import org.apache.fineract.cn.api.util.ApiConstants;
 import org.apache.fineract.cn.api.util.UserContextHolder;
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/service/ApplicationAccessTokenService.java
similarity index 97%
rename from library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
rename to library/src/main/java/org/apache/fineract/cn/permittedfeignclient/service/ApplicationAccessTokenService.java
index d729af3..bdc548b 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
+++ b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/service/ApplicationAccessTokenService.java
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.service;
+package org.apache.fineract.cn.permittedfeignclient.service;
 
-import io.mifos.permittedfeignclient.LibraryConstants;
+import org.apache.fineract.cn.permittedfeignclient.LibraryConstants;
 import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.TimeUnit;
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/service/ApplicationPermissionRequirementsService.java
similarity index 96%
rename from library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java
rename to library/src/main/java/org/apache/fineract/cn/permittedfeignclient/service/ApplicationPermissionRequirementsService.java
index 77b7c3b..1c88584 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java
+++ b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/service/ApplicationPermissionRequirementsService.java
@@ -16,10 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.service;
+package org.apache.fineract.cn.permittedfeignclient.service;
 
-import io.mifos.permittedfeignclient.annotation.EndpointSet;
-import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
+import org.apache.fineract.cn.permittedfeignclient.annotation.EndpointSet;
+import org.apache.finearct.cn.permittedfeignclient.api.v1.domain.ApplicationPermission;
 import org.apache.fineract.cn.anubis.annotation.Permittable;
 import org.apache.fineract.cn.anubis.annotation.Permittables;
 import org.apache.fineract.cn.anubis.api.v1.domain.AllowedOperation;
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/TokenCacheKey.java b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/service/TokenCacheKey.java
similarity index 97%
rename from library/src/main/java/io/mifos/permittedfeignclient/service/TokenCacheKey.java
rename to library/src/main/java/org/apache/fineract/cn/permittedfeignclient/service/TokenCacheKey.java
index b9919e8..107a15b 100644
--- a/library/src/main/java/io/mifos/permittedfeignclient/service/TokenCacheKey.java
+++ b/library/src/main/java/org/apache/fineract/cn/permittedfeignclient/service/TokenCacheKey.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.service;
+package org.apache.fineract.cn.permittedfeignclient.service;
 
 import javax.annotation.Nullable;
 import java.util.Objects;
diff --git a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java b/library/src/test/java/org/apache/fineract/cn/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
similarity index 98%
rename from library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
rename to library/src/test/java/org/apache/fineract/cn/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
index 74f3d68..550a659 100644
--- a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
+++ b/library/src/test/java/org/apache/fineract/cn/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.service;
+package org.apache.fineract.cn.permittedfeignclient.service;
 
 import org.apache.fineract.cn.anubis.config.TenantSignatureRepository;
 import org.apache.fineract.cn.anubis.token.TenantRefreshTokenSerializer;
diff --git a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java b/library/src/test/java/org/apache/fineract/cn/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java
similarity index 95%
rename from library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java
rename to library/src/test/java/org/apache/fineract/cn/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java
index 52e1887..f7e6e1a 100644
--- a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java
+++ b/library/src/test/java/org/apache/fineract/cn/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java
@@ -16,10 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package io.mifos.permittedfeignclient.service;
+package org.apache.fineract.cn.permittedfeignclient.service;
 
-import io.mifos.permittedfeignclient.annotation.EndpointSet;
-import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
+import org.apache.fineract.cn.permittedfeignclient.annotation.EndpointSet;
+import org.apache.finearct.cn.permittedfeignclient.api.v1.domain.ApplicationPermission;
 import java.util.Collections;
 import java.util.Set;
 import java.util.stream.Collectors;


[fineract-cn-permitted-feign-client] 19/27: Adding rat checks.

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit a064616087cb459144b48686db61062803efcf6d
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Apr 9 22:01:24 2018 +0200

    Adding rat checks.
---
 another-for-test/build.gradle    | 18 ++++++++++++++++++
 another-for-test/settings.gradle | 17 +++++++++++++++++
 api/build.gradle                 | 18 ++++++++++++++++++
 api/settings.gradle              | 17 +++++++++++++++++
 build.gradle                     | 25 +++++++++++++++++++++++++
 component-test/build.gradle      | 18 ++++++++++++++++++
 component-test/settings.gradle   | 17 +++++++++++++++++
 library/build.gradle             | 18 ++++++++++++++++++
 library/settings.gradle          | 17 +++++++++++++++++
 settings.gradle                  | 17 +++++++++++++++++
 shared.gradle                    | 30 ++++++++++++++++++++++++++++++
 11 files changed, 212 insertions(+)

diff --git a/another-for-test/build.gradle b/another-for-test/build.gradle
index 7c7eb3c..844d116 100644
--- a/another-for-test/build.gradle
+++ b/another-for-test/build.gradle
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 buildscript {
     ext {
         springBootVersion = '1.4.1.RELEASE'
@@ -14,6 +31,7 @@ buildscript {
 
 plugins {
     id 'com.github.hierynomus.license' version '0.13.1'
+    id("org.nosphere.apache.rat") version "0.3.1"
 }
 
 apply from: '../shared.gradle'
diff --git a/another-for-test/settings.gradle b/another-for-test/settings.gradle
index bd1dca3..96d1a34 100644
--- a/another-for-test/settings.gradle
+++ b/another-for-test/settings.gradle
@@ -1 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 rootProject.name = 'another-for-test'
diff --git a/api/build.gradle b/api/build.gradle
index a5a9150..0c393b6 100644
--- a/api/build.gradle
+++ b/api/build.gradle
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 buildscript {
 
     repositories {
@@ -11,6 +28,7 @@ buildscript {
 
 plugins {
     id 'com.github.hierynomus.license' version '0.13.1'
+    id("org.nosphere.apache.rat") version "0.3.1"
 }
 
 
diff --git a/api/settings.gradle b/api/settings.gradle
index 5cd7dd3..5798b26 100644
--- a/api/settings.gradle
+++ b/api/settings.gradle
@@ -1 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 rootProject.name = 'api'
diff --git a/build.gradle b/build.gradle
index f5737f0..4b0f9a2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 group 'org.apache.fineract.cn'
 
 task publishApiToMavenLocal {
@@ -42,3 +59,11 @@ task prepareForTest {
     dependsOn publishToMavenLocal
     dependsOn gradle.includedBuild('component-test').task(':build')
 }
+
+task rat {
+    group 'all'
+    dependsOn gradle.includedBuild('api').task(':rat')
+    dependsOn gradle.includedBuild('library').task(':rat')
+    dependsOn gradle.includedBuild('another-for-test').task(':rat')
+    dependsOn gradle.includedBuild('component-test').task(':rat')
+}
diff --git a/component-test/build.gradle b/component-test/build.gradle
index 869b9d8..84ebe43 100644
--- a/component-test/build.gradle
+++ b/component-test/build.gradle
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 buildscript {
     ext {
         springBootVersion = '1.4.1.RELEASE'
@@ -14,6 +31,7 @@ buildscript {
 
 plugins {
     id 'com.github.hierynomus.license' version '0.13.1'
+    id("org.nosphere.apache.rat") version "0.3.1"
 }
 
 apply from: '../shared.gradle'
diff --git a/component-test/settings.gradle b/component-test/settings.gradle
index b2e36e3..dc9351a 100644
--- a/component-test/settings.gradle
+++ b/component-test/settings.gradle
@@ -1 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 rootProject.name = 'component-test'
diff --git a/library/build.gradle b/library/build.gradle
index 16838e1..b64e91e 100644
--- a/library/build.gradle
+++ b/library/build.gradle
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 buildscript {
     repositories {
         jcenter()
@@ -10,6 +27,7 @@ buildscript {
 
 plugins {
     id 'com.github.hierynomus.license' version '0.13.1'
+    id("org.nosphere.apache.rat") version "0.3.1"
 }
 
 apply from: '../shared.gradle'
diff --git a/library/settings.gradle b/library/settings.gradle
index 835224a..9731c48 100644
--- a/library/settings.gradle
+++ b/library/settings.gradle
@@ -1 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 rootProject.name = 'library'
diff --git a/settings.gradle b/settings.gradle
index f43e401..e75705d 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 rootProject.name = 'permitted-feign-client'
 
 includeBuild 'api'
diff --git a/shared.gradle b/shared.gradle
index c7a6d95..912a6fb 100644
--- a/shared.gradle
+++ b/shared.gradle
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 group 'org.apache.fineract.cn.permitted-feign-client'
 version '0.1.0-BUILD-SNAPSHOT'
 
@@ -75,3 +92,16 @@ license {
 }
 
 task ci(dependsOn: ['clean', 'test', 'publish'])
+
+rat {
+    // List of exclude directives, defaults to ['**/.gradle/**']
+    excludes = [
+            "**/.idea/**",
+            "**/.gradle/**",
+            "**/gradle/**",
+            "**/build/**",
+            "gradlew",
+            "gradlew.bat",
+            "README.md"
+    ]
+}


[fineract-cn-permitted-feign-client] 01/27: Initial commit.

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 44a4105a9b209126f7e1d196105d026d3e0ce258
Author: myrle-krantz <mk...@mifos.org>
AuthorDate: Wed May 3 23:56:33 2017 +0200

    Initial commit.
---
 .gitignore                                         |  14 ++
 HEADER                                             |  13 ++
 LICENSE                                            | 201 +++++++++++++++++++++
 README.md                                          |  24 +++
 another-for-test/build.gradle                      |  61 +++++++
 another-for-test/settings.gradle                   |   1 +
 .../main/java/io/mifos/another/api/Another.java    |  40 ++++
 .../another/service/AnotherConfiguration.java      |  48 +++++
 .../another/service/AnotherRestController.java     |  53 ++++++
 another-for-test/src/main/resources/logback.xml    |  55 ++++++
 api/build.gradle                                   |  44 +++++
 api/settings.gradle                                |   1 +
 .../client/ApplicationPermissionRequirements.java  |  39 ++++
 .../api/v1/domain/ApplicationPermission.java       |  80 ++++++++
 build.gradle                                       |  44 +++++
 component-test/build.gradle                        |  35 ++++
 component-test/settings.gradle                     |   1 +
 .../src/main/java/TestAccessAnother.java           | 191 ++++++++++++++++++++
 .../main/java/accessanother/api/AccessAnother.java |  34 ++++
 .../service/AccessAnotherConfiguration.java        |  48 +++++
 .../service/AccessAnotherRestController.java       |  51 ++++++
 .../AnotherWithApplicationPermissions.java         |  49 +++++
 gradle/wrapper/gradle-wrapper.jar                  | Bin 0 -> 54212 bytes
 gradle/wrapper/gradle-wrapper.properties           |   6 +
 gradlew                                            | 172 ++++++++++++++++++
 gradlew.bat                                        |  84 +++++++++
 library/build.gradle                               |  56 ++++++
 library/settings.gradle                            |   1 +
 .../annotation/EndpointSet.java                    |  28 +++
 .../PermittedFeignClientsConfiguration.java        |  92 ++++++++++
 .../EnablePermissionRequestingFeignClient.java     |  39 ++++
 ...ermittedFeignClientBeanDefinitionRegistrar.java |  49 +++++
 .../config/PermittedFeignClientConfiguration.java  |  29 +++
 .../config/PermittedFeignClientImportSelector.java |  39 ++++
 ...cationPermissionRequirementsRestController.java |  59 ++++++
 .../ApplicationTokenedTargetInterceptor.java       |  55 ++++++
 .../service/ApplicationAccessTokenService.java     | 143 +++++++++++++++
 .../ApplicationPermissionRequirementsService.java  | 134 ++++++++++++++
 .../service/ApplicationAccessTokenServiceTest.java |  62 +++++++
 ...plicationPermissionRequirementsServiceTest.java | 104 +++++++++++
 settings.gradle                                    |   6 +
 shared.gradle                                      |  79 ++++++++
 42 files changed, 2364 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..300fb08
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+.gradle
+.idea
+build/
+target/
+
+# Ignore Gradle GUI config
+gradle-app.setting
+
+# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
+!gradle-wrapper.jar
+
+*.iml
+
+*.log
diff --git a/HEADER b/HEADER
new file mode 100644
index 0000000..d47a70e
--- /dev/null
+++ b/HEADER
@@ -0,0 +1,13 @@
+Copyright ${year} ${name}.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..8dada3e
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..1f44f4c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,24 @@
+# Mifos I/O Permitted Feign Client Library
+
+[![Join the chat at https://gitter.im/mifos-initiative/mifos.io](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mifos-initiative/mifos.io?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+This project provides secured access to other microservices via Feign. For this it uses anubis and identity to provide refresh and access tokens transparently.
+
+## Abstract
+Mifos I/O is an application framework for digital financial services, a system to support nationwide and cross-national financial transactions and help to level and speed the creation of an inclusive, interconnected digital economy for every nation in the world.
+
+## Versioning
+The version numbers follow the [Semantic Versioning](http://semver.org/) scheme.
+
+In addition to MAJOR.MINOR.PATCH the following postfixes are used to indicate the development state.
+
+* BUILD-SNAPSHOT - A release currently in development. 
+* RELEASE - _General availability_ indicates that this release is the best available version and is recommended for all usage.
+
+The versioning layout is {MAJOR}.{MINOR}.{PATCH}-{INDICATOR}[.{PATCH}]. Only milestones and release candidates can  have patch versions. Some examples:
+
+1.2.3-BUILD-SNAPSHOT  
+1.3.5-RELEASE
+
+## License
+See [LICENSE](LICENSE) file.
diff --git a/another-for-test/build.gradle b/another-for-test/build.gradle
new file mode 100644
index 0000000..56ee324
--- /dev/null
+++ b/another-for-test/build.gradle
@@ -0,0 +1,61 @@
+buildscript {
+    ext {
+        springBootVersion = '1.4.1.RELEASE'
+    }
+
+    repositories {
+        jcenter()
+    }
+
+    dependencies {
+        classpath ("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
+    }
+}
+
+plugins {
+    id 'com.github.hierynomus.license' version '0.13.1'
+}
+
+apply from: '../shared.gradle'
+
+apply plugin: 'spring-boot'
+
+springBoot {
+    executable = true
+    classifier = 'boot'
+}
+
+dependencies {
+    compile(
+            [group: 'org.springframework.cloud', name: 'spring-cloud-starter-config'],
+            [group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka'],
+            [group: 'org.springframework.boot', name: 'spring-boot-starter-jetty'],
+            [group: 'org.hibernate', name: 'hibernate-validator', version: versions.hibernatevalidator],
+            [group: 'io.mifos.core', name: 'lang', version: versions.frameworklang],
+            [group: 'io.mifos.core', name: 'cassandra', version: versions.frameworkcassandra],
+            [group: 'io.jsonwebtoken', name: 'jjwt', version: versions.jjwt],
+            [group: 'io.mifos.anubis', name: 'api', version: versions.frameworkanubis],
+            [group: 'io.mifos.anubis', name: 'library', version: versions.frameworkanubis],
+    )
+}
+
+publishToMavenLocal.dependsOn bootRepackage
+
+
+publishing {
+    publications {
+        service(MavenPublication) {
+            from components.java
+            groupId project.group
+            artifactId project.name
+            version project.version
+        }
+        bootService(MavenPublication) {
+            // "boot" jar
+            artifact ("$buildDir/libs/$project.name-$version-boot.jar")
+            groupId project.group
+            artifactId ("service-boot")
+            version project.version
+        }
+    }
+}
diff --git a/another-for-test/settings.gradle b/another-for-test/settings.gradle
new file mode 100644
index 0000000..bd1dca3
--- /dev/null
+++ b/another-for-test/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'another-for-test'
diff --git a/another-for-test/src/main/java/io/mifos/another/api/Another.java b/another-for-test/src/main/java/io/mifos/another/api/Another.java
new file mode 100644
index 0000000..7b72fd4
--- /dev/null
+++ b/another-for-test/src/main/java/io/mifos/another/api/Another.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.another.api;
+
+import io.mifos.anubis.api.v1.client.Anubis;
+import io.mifos.core.api.util.CustomFeignClientsConfiguration;
+import org.springframework.cloud.netflix.feign.FeignClient;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+/**
+ * @author Myrle Krantz
+ */
+@SuppressWarnings("unused")
+@FeignClient(name="another-v1", path="/another/v1", configuration = CustomFeignClientsConfiguration.class)
+public interface Another extends Anubis {
+  @RequestMapping(value = "/foo", method = RequestMethod.POST,
+          consumes = {MediaType.APPLICATION_JSON_VALUE},
+          produces = {MediaType.ALL_VALUE})
+  void createFoo();
+
+  @RequestMapping(value = "/foo", method = RequestMethod.GET,
+          consumes = {MediaType.APPLICATION_JSON_VALUE},
+          produces = {MediaType.ALL_VALUE})
+  boolean getFoo();
+}
diff --git a/another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java b/another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java
new file mode 100644
index 0000000..a3ade44
--- /dev/null
+++ b/another-for-test/src/main/java/io/mifos/another/service/AnotherConfiguration.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.another.service;
+
+import io.mifos.anubis.config.EnableAnubis;
+import io.mifos.core.lang.config.EnableApplicationName;
+import io.mifos.core.lang.config.EnableServiceException;
+import io.mifos.core.lang.config.EnableTenantContext;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+
+/**
+ * @author Myrle Krantz
+ */
+@Configuration
+@EnableAutoConfiguration
+@EnableWebMvc
+@EnableDiscoveryClient
+@EnableTenantContext
+@EnableAnubis(generateEmptyInitializeEndpoint = true)
+@EnableApplicationName
+@EnableServiceException
+@ComponentScan({
+        "io.mifos.another.service"
+})
+public class AnotherConfiguration {
+
+  public static void main(String[] args) {
+    SpringApplication.run(AnotherConfiguration.class, args);
+  }
+}
diff --git a/another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java b/another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java
new file mode 100644
index 0000000..f1630a6
--- /dev/null
+++ b/another-for-test/src/main/java/io/mifos/another/service/AnotherRestController.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.another.service;
+
+import io.mifos.anubis.annotation.AcceptedTokenType;
+import io.mifos.anubis.annotation.Permittable;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author Myrle Krantz
+ */
+@RestController
+public class AnotherRestController {
+
+  private boolean fooWasPosted;
+
+  @RequestMapping(
+          value = "/foo",
+          method = RequestMethod.POST
+  )
+  @Permittable(value = AcceptedTokenType.GUEST)
+  public @ResponseBody
+  ResponseEntity<Void> resourceThatNeedsAnotherResource() {
+    fooWasPosted = true;
+    return ResponseEntity.ok().build();
+  }
+
+  @RequestMapping(
+          value = "/foo",
+          method = RequestMethod.GET
+  )
+  @Permittable(value = AcceptedTokenType.GUEST)
+  public @ResponseBody ResponseEntity<Boolean> getFoo() {
+    return ResponseEntity.ok(fooWasPosted);
+  }
+}
diff --git a/another-for-test/src/main/resources/logback.xml b/another-for-test/src/main/resources/logback.xml
new file mode 100644
index 0000000..73b6cf3
--- /dev/null
+++ b/another-for-test/src/main/resources/logback.xml
@@ -0,0 +1,55 @@
+<!--
+
+    Copyright 2017 The Mifos Initiative.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<configuration>
+    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>logs/another.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>another.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <maxHistory>7</maxHistory>
+            <totalSizeCap>2GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <logger name="com" level="INFO">
+        <appender-ref ref="STDOUT" />
+    </logger>
+
+    <logger name="org" level="INFO">
+        <appender-ref ref="STDOUT" />
+    </logger>
+
+    <logger name="io" level="INFO">
+        <appender-ref ref="STDOUT" />
+    </logger>
+
+    <logger name="net" level="INFO">
+        <appender-ref ref="STDOUT" />
+    </logger>
+
+    <root level="DEBUG">
+        <appender-ref ref="FILE"/>
+    </root>
+</configuration>
\ No newline at end of file
diff --git a/api/build.gradle b/api/build.gradle
new file mode 100644
index 0000000..1a5afae
--- /dev/null
+++ b/api/build.gradle
@@ -0,0 +1,44 @@
+buildscript {
+
+    repositories {
+        jcenter()
+    }
+
+    dependencies {
+        classpath 'io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE'
+    }
+}
+
+plugins {
+    id 'com.github.hierynomus.license' version '0.13.1'
+}
+
+
+apply from: '../shared.gradle'
+
+apply plugin: 'io.spring.dependency-management'
+
+dependencies {
+    compile (
+            [group: 'org.springframework.cloud', name: 'spring-cloud-starter-feign'],
+            [group: 'org.hibernate', name: 'hibernate-validator', version: versions.hibernatevalidator],
+            [group: 'com.google.code.gson', name: 'gson'],
+            [group: 'io.mifos.core', name: 'api', version: versions.frameworkapi],
+            [group: 'io.mifos.identity', name: 'api', version: versions.frameworkidentity]
+    )
+
+    testCompile(
+            [group: 'io.mifos.core', name: 'test', version: versions.frameworktest],
+    )
+}
+
+publishing {
+    publications {
+        apiPublication(MavenPublication) {
+            from components.java
+            groupId project.group
+            artifactId project.name
+            version project.version
+        }
+    }
+}
diff --git a/api/settings.gradle b/api/settings.gradle
new file mode 100644
index 0000000..5cd7dd3
--- /dev/null
+++ b/api/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'api'
diff --git a/api/src/main/java/io/mifos/permittedfeignclient/api/v1/client/ApplicationPermissionRequirements.java b/api/src/main/java/io/mifos/permittedfeignclient/api/v1/client/ApplicationPermissionRequirements.java
new file mode 100644
index 0000000..b3a971b
--- /dev/null
+++ b/api/src/main/java/io/mifos/permittedfeignclient/api/v1/client/ApplicationPermissionRequirements.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.api.v1.client;
+
+import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
+import org.springframework.cloud.netflix.feign.FeignClient;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * @author Myrle Krantz
+ */
+@SuppressWarnings({"WeakerAccess", "unused"})
+@FeignClient
+public interface ApplicationPermissionRequirements {
+  @RequestMapping(
+      value = "/requiredpermissions",
+      method = RequestMethod.GET,
+      consumes = MediaType.APPLICATION_JSON_VALUE,
+      produces = MediaType.ALL_VALUE
+  )
+  List<ApplicationPermission> getRequiredPermissions();
+}
diff --git a/api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java b/api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java
new file mode 100644
index 0000000..84e999e
--- /dev/null
+++ b/api/src/main/java/io/mifos/permittedfeignclient/api/v1/domain/ApplicationPermission.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.api.v1.domain;
+
+import io.mifos.core.lang.validation.constraints.ValidIdentifier;
+import io.mifos.identity.api.v1.domain.Permission;
+
+import javax.annotation.Nullable;
+import javax.validation.Valid;
+import java.util.Objects;
+
+/**
+ * @author Myrle Krantz
+ */
+@SuppressWarnings("unused")
+public class ApplicationPermission {
+  @ValidIdentifier
+  private String endpointSetIdentifier;
+  @Valid
+  private Permission permission;
+
+  public ApplicationPermission() {
+  }
+
+  public ApplicationPermission(@Nullable String endpointSetIdentifier, Permission permission) {
+    this.endpointSetIdentifier = endpointSetIdentifier;
+    this.permission = permission;
+  }
+
+  public String getEndpointSetIdentifier() {
+    return endpointSetIdentifier;
+  }
+
+  public void setEndpointSetIdentifier(String endpointSetIdentifier) {
+    this.endpointSetIdentifier = endpointSetIdentifier;
+  }
+
+  public Permission getPermission() {
+    return permission;
+  }
+
+  public void setPermission(Permission permission) {
+    this.permission = permission;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+    ApplicationPermission that = (ApplicationPermission) o;
+    return Objects.equals(endpointSetIdentifier, that.endpointSetIdentifier) &&
+            Objects.equals(permission, that.permission);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(endpointSetIdentifier, permission);
+  }
+
+  @Override
+  public String toString() {
+    return "ApplicationPermission{" +
+            "endpointSetIdentifier='" + endpointSetIdentifier + '\'' +
+            ", permission=" + permission +
+            '}';
+  }
+}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..e2216eb
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,44 @@
+group 'io.mifos'
+
+task publishApiToMavenLocal {
+    dependsOn gradle.includedBuild('api').task(':publishToMavenLocal')
+}
+
+task publishLibraryToMavenLocal {
+    mustRunAfter publishApiToMavenLocal
+    dependsOn gradle.includedBuild('library').task(':publishToMavenLocal')
+}
+
+task publishAnotherForTestToMavenLocal {
+    mustRunAfter publishLibraryToMavenLocal
+    dependsOn gradle.includedBuild('another-for-test').task(':publishToMavenLocal')
+}
+
+task publishComponentTestToMavenLocal {
+    mustRunAfter publishApiToMavenLocal
+    mustRunAfter publishLibraryToMavenLocal
+    mustRunAfter publishAnotherForTestToMavenLocal
+    dependsOn gradle.includedBuild('component-test').task(':publishToMavenLocal')
+}
+
+task publishToMavenLocal {
+    group 'all'
+    dependsOn publishApiToMavenLocal
+    dependsOn publishLibraryToMavenLocal
+    dependsOn publishAnotherForTestToMavenLocal
+    dependsOn publishComponentTestToMavenLocal
+}
+
+task licenseFormat {
+    group 'all'
+    dependsOn gradle.includedBuild('api').task(':licenseFormat')
+    dependsOn gradle.includedBuild('library').task(':licenseFormat')
+    dependsOn gradle.includedBuild('another-for-test').task(':licenseFormat')
+    dependsOn gradle.includedBuild('component-test').task(':licenseFormat')
+}
+
+task prepareForTest {
+    group 'all'
+    dependsOn publishToMavenLocal
+    dependsOn gradle.includedBuild('component-test').task(':build')
+}
diff --git a/component-test/build.gradle b/component-test/build.gradle
new file mode 100644
index 0000000..4ed858f
--- /dev/null
+++ b/component-test/build.gradle
@@ -0,0 +1,35 @@
+buildscript {
+    ext {
+        springBootVersion = '1.4.1.RELEASE'
+    }
+
+    repositories {
+        jcenter()
+    }
+
+    dependencies {
+        classpath ("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
+    }
+}
+
+plugins {
+    id 'com.github.hierynomus.license' version '0.13.1'
+}
+
+apply from: '../shared.gradle'
+
+dependencies {
+    compile(
+            [group: 'org.springframework.cloud', name: 'spring-cloud-starter-config'],
+            [group: 'org.springframework.boot', name: 'spring-boot-starter-jetty'],
+            [group: 'org.springframework.boot', name: 'spring-boot-starter-test'],
+            [group: 'com.google.code.gson', name: 'gson'],
+            [group: 'io.jsonwebtoken', name: 'jjwt', version: versions.jjwt],
+            [group: 'io.mifos.core', name: 'api', version: versions.frameworkapi],
+            [group: 'io.mifos.core', name: 'test', version: versions.frameworktest],
+            [group: 'io.mifos', name: 'service-starter', version: versions.frameworkservicestarter],
+            [group: 'io.mifos.permitted-feign-client', name: 'another-for-test', version: rootProject.version],
+            [group: 'io.mifos.permitted-feign-client', name: 'library', version: rootProject.version],
+            [group: 'io.mifos.permitted-feign-client', name: 'api', version: rootProject.version],
+    )
+}
diff --git a/component-test/settings.gradle b/component-test/settings.gradle
new file mode 100644
index 0000000..b2e36e3
--- /dev/null
+++ b/component-test/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'component-test'
diff --git a/component-test/src/main/java/TestAccessAnother.java b/component-test/src/main/java/TestAccessAnother.java
new file mode 100644
index 0000000..c896c9d
--- /dev/null
+++ b/component-test/src/main/java/TestAccessAnother.java
@@ -0,0 +1,191 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import accessanother.api.AccessAnother;
+import accessanother.service.AccessAnotherConfiguration;
+import io.mifos.another.api.Another;
+import io.mifos.anubis.api.v1.domain.AllowedOperation;
+import io.mifos.anubis.test.v1.TenantApplicationSecurityEnvironmentTestRule;
+import io.mifos.core.api.config.EnableApiFactory;
+import io.mifos.core.api.context.AutoUserContext;
+import io.mifos.core.api.util.ApiFactory;
+import io.mifos.core.lang.DateConverter;
+import io.mifos.core.test.env.TestEnvironment;
+import io.mifos.core.test.fixture.cassandra.CassandraInitializer;
+import io.mifos.core.test.servicestarter.EurekaForTest;
+import io.mifos.core.test.servicestarter.InitializedMicroservice;
+import io.mifos.core.test.servicestarter.IntegrationTestEnvironment;
+import io.mifos.identity.api.v1.client.IdentityManager;
+import io.mifos.identity.api.v1.domain.Authentication;
+import io.mifos.identity.api.v1.domain.Permission;
+import io.mifos.permittedfeignclient.api.v1.client.ApplicationPermissionRequirements;
+import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
+import org.junit.*;
+import org.junit.rules.RuleChain;
+import org.junit.rules.TestRule;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import static accessanother.service.apiforother.AnotherWithApplicationPermissions.ENDPOINT_SET_IDENTIFIER;
+import static io.mifos.core.test.env.TestEnvironment.RIBBON_USES_EUREKA_PROPERTY;
+import static io.mifos.core.test.env.TestEnvironment.SPRING_CLOUD_DISCOVERY_ENABLED_PROPERTY;
+
+/**
+ * @author Myrle Krantz
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
+public class TestAccessAnother {
+  private static final String APP_NAME = "accessanother-v1";
+  private static final String LOGGER_QUALIFIER = "test-logger";
+  private static final String USER_NAME = "blah";
+
+  @Configuration
+  @EnableApiFactory
+  @Import({AccessAnotherConfiguration.class})
+  public static class TestConfiguration {
+    public TestConfiguration() {
+      super();
+    }
+
+    @Bean(name = LOGGER_QUALIFIER)
+    public Logger logger() {
+      return LoggerFactory.getLogger(APP_NAME + "-logger");
+    }
+  }
+
+  private final static EurekaForTest eurekaForTest = new EurekaForTest();
+  private final static CassandraInitializer cassandraInitializer = new CassandraInitializer();
+  private final static IntegrationTestEnvironment integrationTestEnvironment = new IntegrationTestEnvironment(cassandraInitializer);
+  private final static InitializedMicroservice<Another> another= new InitializedMicroservice<>(Another.class, "permitted-feign-client", "0.1.0-BUILD-SNAPSHOT", integrationTestEnvironment);
+
+  @ClassRule
+  public static TestRule orderedRules = RuleChain
+          .outerRule(eurekaForTest)
+          .around(cassandraInitializer)
+          .around(integrationTestEnvironment)
+          .around(another);
+
+
+  private final static TestEnvironment testEnvironment = new TestEnvironment(APP_NAME);
+
+  @BeforeClass
+  public static void someExtraTestEnvironmentStuff() {
+    testEnvironment.setKeyPair(integrationTestEnvironment.getSeshatKeyTimestamp(), integrationTestEnvironment.getSeshatPublicKey(), integrationTestEnvironment.getSeshatPrivateKey());
+    testEnvironment.setProperty("eureka.client.serviceUrl.defaultZone", "http://localhost:8761/eureka");
+    testEnvironment.setProperty(SPRING_CLOUD_DISCOVERY_ENABLED_PROPERTY, "true");
+    testEnvironment.setProperty(RIBBON_USES_EUREKA_PROPERTY, "true");
+    testEnvironment.setProperty("eureka.instance.hostname", "localhost");
+    testEnvironment.setProperty("eureka.client.fetchRegistry", "true");
+    testEnvironment.setProperty("eureka.registration.enabled", "true");
+    testEnvironment.setProperty("eureka.instance.leaseRenewalIntervalInSeconds", "1"); //Speed up registration for test purposes.
+    testEnvironment.setProperty("eureka.client.initialInstanceInfoReplicationIntervalSeconds", "0");  //Speed up initial registration for test purposes.
+    testEnvironment.setProperty("eureka.client.instanceInfoReplicationIntervalSeconds", "1");
+    testEnvironment.populate();
+  }
+
+  @Rule
+  public final TenantApplicationSecurityEnvironmentTestRule tenantApplicationSecurityEnvironment
+          = new TenantApplicationSecurityEnvironmentTestRule(APP_NAME,
+          testEnvironment.serverURI(), integrationTestEnvironment.getSystemSecurityEnvironment(),
+          this::waitForInitialize);
+
+  @SuppressWarnings({"SpringAutowiredFieldsWarningInspection", "SpringJavaAutowiredMembersInspection"})
+  @Autowired
+  private ApiFactory apiFactory;
+
+  @MockBean
+  private IdentityManager identityManager;
+
+  private AccessAnother accessAnother;
+  private ApplicationPermissionRequirements applicationPermissionRequirements;
+
+  @Before
+  public void before()
+  {
+    another.setApiFactory(apiFactory);
+    accessAnother = apiFactory.create(AccessAnother.class, testEnvironment.serverURI());
+    applicationPermissionRequirements = apiFactory.create(ApplicationPermissionRequirements.class, testEnvironment.serverURI());
+  }
+
+
+  public boolean waitForInitialize() {
+    try {
+      TimeUnit.SECONDS.sleep(15);
+      return true;
+    } catch (final InterruptedException e) {
+      throw new IllegalStateException(e);
+    }
+  }
+
+  @Test
+  public void permissionRequirementsListedProperly() {
+    final List<ApplicationPermission> requiredPermissions = applicationPermissionRequirements.getRequiredPermissions();
+    Assert.assertFalse(requiredPermissions.isEmpty());
+    Assert.assertTrue(requiredPermissions.toString(), requiredPermissions.contains(
+            new ApplicationPermission(ENDPOINT_SET_IDENTIFIER,
+                    new Permission(accessanother.service.apiforother.AnotherWithApplicationPermissions.ANOTHER_FOO_PERMITTABLE_GROUP,
+                            new HashSet<>(Arrays.asList(AllowedOperation.READ, AllowedOperation.CHANGE))))));
+  }
+
+  @Test
+  public void canAccessAnother()
+  {
+    try (final AutoUserContext ignored = integrationTestEnvironment.createAutoUserContext(USER_NAME)) {
+      Assert.assertFalse(another.api().getFoo());
+    }
+
+    mockIdentityManagerInteraction();
+    try (final AutoUserContext ignored = tenantApplicationSecurityEnvironment.createAutoUserContext("blah")) {
+      accessAnother.createDummy();
+    }
+    try (final AutoUserContext ignored = integrationTestEnvironment.createAutoUserContext("blah")) {
+      Assert.assertTrue(another.api().getFoo());
+    }
+  }
+
+  private void mockIdentityManagerInteraction() {
+    final String token = tenantApplicationSecurityEnvironment.getSystemSecurityEnvironment()
+            .getPermissionToken(USER_NAME, "another-v1", "/foo", AllowedOperation.CHANGE);
+
+    final String expirationString = getExpirationString();
+    final Authentication applicationAuthentication = new Authentication(token, expirationString, expirationString, null);
+    Mockito.doReturn(applicationAuthentication).when(identityManager).refresh(Mockito.anyString());
+  }
+
+  private String getExpirationString() {
+    final long issued = System.currentTimeMillis();
+    final Date expiration = new Date(issued + TimeUnit.SECONDS.toMillis(30));
+    final LocalDateTime localDateTimeExpiration = LocalDateTime.ofInstant(expiration.toInstant(), ZoneId.of("UTC"));
+    return DateConverter.toIsoString(localDateTimeExpiration);
+  }
+}
diff --git a/component-test/src/main/java/accessanother/api/AccessAnother.java b/component-test/src/main/java/accessanother/api/AccessAnother.java
new file mode 100644
index 0000000..ea1ad7d
--- /dev/null
+++ b/component-test/src/main/java/accessanother/api/AccessAnother.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package accessanother.api;
+
+import io.mifos.anubis.api.v1.client.Anubis;
+import io.mifos.core.api.util.CustomFeignClientsConfiguration;
+import org.springframework.cloud.netflix.feign.FeignClient;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+/**
+ * @author Myrle Krantz
+ */
+@FeignClient(name="accessanother-v1", path="/accessanother/v1", configuration = CustomFeignClientsConfiguration.class)
+public interface AccessAnother extends Anubis {
+  @RequestMapping(value = "/dummy", method = RequestMethod.POST,
+          consumes = {MediaType.APPLICATION_JSON_VALUE},
+          produces = {MediaType.ALL_VALUE})
+  void createDummy();
+}
diff --git a/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java b/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java
new file mode 100644
index 0000000..486d491
--- /dev/null
+++ b/component-test/src/main/java/accessanother/service/AccessAnotherConfiguration.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package accessanother.service;
+
+import accessanother.service.apiforother.AnotherWithApplicationPermissions;
+import io.mifos.anubis.config.EnableAnubis;
+import io.mifos.core.lang.config.EnableServiceException;
+import io.mifos.core.lang.config.EnableTenantContext;
+import io.mifos.permittedfeignclient.config.EnablePermissionRequestingFeignClient;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.netflix.feign.EnableFeignClients;
+import org.springframework.cloud.netflix.ribbon.RibbonClient;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+
+/**
+ * @author Myrle Krantz
+ */
+@Configuration
+@EnableAutoConfiguration
+@EnableWebMvc
+@EnableDiscoveryClient
+@EnableTenantContext
+@EnableAnubis(generateEmptyInitializeEndpoint = true)
+@EnableFeignClients(basePackages = {"accessanother.service.apiforother"})
+@RibbonClient(name = "accessanother-v1")
+@EnableServiceException
+@EnablePermissionRequestingFeignClient(feignClasses = {AnotherWithApplicationPermissions.class})
+@ComponentScan({
+        "accessanother.service"
+})
+public class AccessAnotherConfiguration {
+}
diff --git a/component-test/src/main/java/accessanother/service/AccessAnotherRestController.java b/component-test/src/main/java/accessanother/service/AccessAnotherRestController.java
new file mode 100644
index 0000000..31f89e0
--- /dev/null
+++ b/component-test/src/main/java/accessanother/service/AccessAnotherRestController.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package accessanother.service;
+
+import accessanother.service.apiforother.AnotherWithApplicationPermissions;
+import io.mifos.anubis.annotation.Permittable;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * @author Myrle Krantz
+ */
+@RestController
+public class AccessAnotherRestController {
+  private final AnotherWithApplicationPermissions anotherWithApplicationPermissions;
+
+  @Autowired
+  public AccessAnotherRestController(@SuppressWarnings("SpringJavaAutowiringInspection") final AnotherWithApplicationPermissions anotherWithApplicationPermissions) {
+
+    this.anotherWithApplicationPermissions = anotherWithApplicationPermissions;
+  }
+
+  @RequestMapping(
+          value = "/dummy",
+          method = RequestMethod.POST
+  )
+  @Permittable()
+  public @ResponseBody
+  ResponseEntity<Void> resourceThatNeedsAnotherResource() {
+    anotherWithApplicationPermissions.createFoo();
+    return ResponseEntity.ok().build();
+  }
+}
\ No newline at end of file
diff --git a/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java b/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java
new file mode 100644
index 0000000..f9ccc7e
--- /dev/null
+++ b/component-test/src/main/java/accessanother/service/apiforother/AnotherWithApplicationPermissions.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package accessanother.service.apiforother;
+
+import io.mifos.anubis.annotation.Permittable;
+import io.mifos.permittedfeignclient.annotation.EndpointSet;
+import io.mifos.permittedfeignclient.annotation.PermittedFeignClientsConfiguration;
+import org.springframework.cloud.netflix.feign.FeignClient;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+/**
+ * @author Myrle Krantz
+ */
+@EndpointSet(identifier = AnotherWithApplicationPermissions.ENDPOINT_SET_IDENTIFIER)
+@FeignClient(name="another-v1", path="/another/v1", configuration = PermittedFeignClientsConfiguration.class)
+public interface AnotherWithApplicationPermissions {
+  String ENDPOINT_SET_IDENTIFIER = "x";
+  String ANOTHER_FOO_PERMITTABLE_GROUP = "group_for_another";
+
+  @RequestMapping(value = "/foo", method = RequestMethod.POST,
+          consumes = {MediaType.APPLICATION_JSON_VALUE},
+          produces = {MediaType.ALL_VALUE})
+  @Permittable(groupId = ANOTHER_FOO_PERMITTABLE_GROUP)
+  void createFoo();
+
+  @RequestMapping(value = "/foo", method = RequestMethod.GET,
+          consumes = {MediaType.APPLICATION_JSON_VALUE},
+          produces = {MediaType.ALL_VALUE})
+  @Permittable(groupId = ANOTHER_FOO_PERMITTABLE_GROUP)
+  boolean getFoo();
+
+  //TODO: also test multiple permittables.
+  //TODO: also think about upgradeability when permission needs change.
+}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..7724e6e
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..8521cd8
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue Apr 18 15:55:31 CEST 2017
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..4453cce
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+    echo "$*"
+}
+
+die ( ) {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save ( ) {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..e95643d
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/library/build.gradle b/library/build.gradle
new file mode 100644
index 0000000..39c27a4
--- /dev/null
+++ b/library/build.gradle
@@ -0,0 +1,56 @@
+buildscript {
+    repositories {
+        jcenter()
+    }
+
+    dependencies {
+        classpath 'io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE'
+    }
+}
+
+plugins {
+    id 'com.github.hierynomus.license' version '0.13.1'
+}
+
+apply from: '../shared.gradle'
+
+apply plugin: 'io.spring.dependency-management'
+
+dependencyManagement {
+    imports {
+        mavenBom 'org.springframework.cloud:spring-cloud-netflix:1.2.0.RELEASE'
+    }
+}
+
+dependencies {
+    compile(
+            [group: 'org.springframework.cloud', name: 'spring-cloud-starter-feign'],
+            [group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka'],
+            [group: 'org.springframework.cloud', name: 'spring-cloud-starter-security'],
+            [group: 'org.hibernate', name: 'hibernate-validator', version: versions.hibernatevalidator],
+            [group: 'io.jsonwebtoken', name: 'jjwt', version: versions.jjwt],
+            [group: 'io.mifos.core', name: 'lang', version: versions.frameworklang],
+            [group: 'io.mifos.core', name: 'api', version: versions.frameworkapi],
+            [group: 'io.mifos.core', name: 'cassandra', version: versions.frameworkcassandra],
+            [group: 'io.mifos.anubis', name: 'api', version: versions.frameworkanubis],
+            [group: 'io.mifos.anubis', name: 'library', version: versions.frameworkanubis],
+            [group: 'io.mifos.permitted-feign-client', name: 'api', version: rootProject.version],
+            [group: 'net.jodah', name: 'expiringmap', version: versions.expiringmap],
+
+    )
+}
+
+jar {
+    from sourceSets.main.allSource
+}
+
+publishing {
+    publications {
+        libraryPublication(MavenPublication) {
+            from components.java
+            groupId project.group
+            artifactId project.name
+            version project.version
+        }
+    }
+}
diff --git a/library/settings.gradle b/library/settings.gradle
new file mode 100644
index 0000000..835224a
--- /dev/null
+++ b/library/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'library'
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/annotation/EndpointSet.java b/library/src/main/java/io/mifos/permittedfeignclient/annotation/EndpointSet.java
new file mode 100644
index 0000000..def34f4
--- /dev/null
+++ b/library/src/main/java/io/mifos/permittedfeignclient/annotation/EndpointSet.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * @author Myrle Krantz
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Documented
+public @interface EndpointSet {
+  String identifier() default "";
+}
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java b/library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java
new file mode 100644
index 0000000..cf84031
--- /dev/null
+++ b/library/src/main/java/io/mifos/permittedfeignclient/annotation/PermittedFeignClientsConfiguration.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.annotation;
+
+import feign.Feign;
+import feign.Target;
+import feign.codec.Decoder;
+import feign.codec.Encoder;
+import feign.gson.GsonDecoder;
+import feign.gson.GsonEncoder;
+import io.mifos.core.api.util.AnnotatedErrorDecoder;
+import io.mifos.core.api.util.TenantedTargetInterceptor;
+import io.mifos.permittedfeignclient.security.ApplicationTokenedTargetInterceptor;
+import io.mifos.permittedfeignclient.service.ApplicationAccessTokenService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.cloud.netflix.feign.FeignClientsConfiguration;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Scope;
+
+import static io.mifos.core.api.config.ApiConfiguration.LOGGER_NAME;
+
+/**
+ * @author Myrle Krantz
+ */
+public class PermittedFeignClientsConfiguration extends FeignClientsConfiguration {
+  private static class FeignBuilder extends Feign.Builder {
+    private final ApplicationAccessTokenService applicationAccessTokenService;
+    private final Logger logger;
+
+    FeignBuilder(
+            final ApplicationAccessTokenService applicationAccessTokenService,
+            final Logger logger) {
+      this.applicationAccessTokenService = applicationAccessTokenService;
+      this.logger = logger;
+    }
+
+    public <T> T target(final Target<T> target) {
+      this.errorDecoder(new AnnotatedErrorDecoder(logger, target.type()));
+      this.requestInterceptor(new TenantedTargetInterceptor());
+      this.requestInterceptor(new ApplicationTokenedTargetInterceptor(
+              applicationAccessTokenService,
+              target.type()));
+      return build().newInstance(target);
+    }
+  }
+
+  @Bean
+  @ConditionalOnMissingBean
+  public Decoder feignDecoder() {
+    return new GsonDecoder();
+  }
+
+  @Bean
+  @ConditionalOnMissingBean
+  public Encoder feignEncoder() {
+    return new GsonEncoder();
+  }
+
+  @Bean(name = LOGGER_NAME)
+  @ConditionalOnMissingBean
+  public Logger logger() {
+    return LoggerFactory.getLogger(LOGGER_NAME);
+  }
+
+  @Bean
+  @Scope("prototype")
+  @ConditionalOnMissingBean
+  public Feign.Builder permittedFeignBuilder(
+          @SuppressWarnings("SpringJavaAutowiringInspection")
+          final ApplicationAccessTokenService applicationAccessTokenService,
+          @Qualifier(LOGGER_NAME) final Logger logger) {
+    return new FeignBuilder(
+            applicationAccessTokenService,
+            logger);
+  }
+}
\ No newline at end of file
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/EnablePermissionRequestingFeignClient.java b/library/src/main/java/io/mifos/permittedfeignclient/config/EnablePermissionRequestingFeignClient.java
new file mode 100644
index 0000000..93213dc
--- /dev/null
+++ b/library/src/main/java/io/mifos/permittedfeignclient/config/EnablePermissionRequestingFeignClient.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.config;
+
+import org.springframework.context.annotation.Import;
+
+import java.lang.annotation.*;
+
+/**
+ * @author Myrle Krantz
+ */
+@SuppressWarnings({"unused", "WeakerAccess"})
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+@Import({
+        PermittedFeignClientBeanDefinitionRegistrar.class,
+        PermittedFeignClientImportSelector.class,
+        PermittedFeignClientConfiguration.class,
+})
+public @interface EnablePermissionRequestingFeignClient {
+  /**
+   * @return A list of classes annotated with @EndpointSet and @FeignClient
+   */
+  Class<?>[] feignClasses() default {};
+}
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientBeanDefinitionRegistrar.java b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientBeanDefinitionRegistrar.java
new file mode 100644
index 0000000..879e39b
--- /dev/null
+++ b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientBeanDefinitionRegistrar.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.config;
+
+import io.mifos.permittedfeignclient.service.ApplicationPermissionRequirementsService;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
+import org.springframework.core.type.AnnotationMetadata;
+
+import static org.springframework.beans.factory.config.BeanDefinition.SCOPE_SINGLETON;
+
+/**
+ * @author Myrle Krantz
+ */
+@SuppressWarnings("WeakerAccess")
+public class PermittedFeignClientBeanDefinitionRegistrar implements ImportBeanDefinitionRegistrar {
+
+  @Override
+  public void registerBeanDefinitions(
+          final AnnotationMetadata importingClassMetadata,
+          final BeanDefinitionRegistry registry) {
+
+    final Object clients = importingClassMetadata.getAnnotationAttributes(
+            EnablePermissionRequestingFeignClient.class.getTypeName()).get("feignClasses");
+
+    final AbstractBeanDefinition beanDefinition = BeanDefinitionBuilder
+            .genericBeanDefinition(ApplicationPermissionRequirementsService.class)
+            .addConstructorArgValue(clients)
+            .setScope(SCOPE_SINGLETON)
+            .getBeanDefinition();
+
+    registry.registerBeanDefinition("applicationPermissionRequirementsService", beanDefinition);
+  }
+}
\ No newline at end of file
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
new file mode 100644
index 0000000..b37a43b
--- /dev/null
+++ b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientConfiguration.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.config;
+
+import io.mifos.anubis.config.EnableAnubis;
+import org.springframework.cloud.netflix.feign.EnableFeignClients;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @author Myrle Krantz
+ */
+@EnableAnubis
+@EnableFeignClients(basePackages = {"io.mifos.identity.api.v1"})
+@Configuration
+public class PermittedFeignClientConfiguration {
+}
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientImportSelector.java b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientImportSelector.java
new file mode 100644
index 0000000..3ecb36c
--- /dev/null
+++ b/library/src/main/java/io/mifos/permittedfeignclient/config/PermittedFeignClientImportSelector.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.config;
+
+import io.mifos.permittedfeignclient.controller.ApplicationPermissionRequirementsRestController;
+import io.mifos.permittedfeignclient.service.ApplicationAccessTokenService;
+import org.springframework.context.annotation.ImportSelector;
+import org.springframework.core.type.AnnotationMetadata;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author Myrle Krantz
+ */
+class PermittedFeignClientImportSelector implements ImportSelector {
+  PermittedFeignClientImportSelector() { }
+
+  @Override public String[] selectImports(AnnotationMetadata importingClassMetadata) {
+    final Set<Class> classesToImport = new HashSet<>();
+    classesToImport.add(ApplicationPermissionRequirementsRestController.class);
+    classesToImport.add(ApplicationAccessTokenService.class);
+
+    return classesToImport.stream().map(Class::getCanonicalName).toArray(String[]::new);
+  }
+}
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java b/library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java
new file mode 100644
index 0000000..b34a147
--- /dev/null
+++ b/library/src/main/java/io/mifos/permittedfeignclient/controller/ApplicationPermissionRequirementsRestController.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.controller;
+
+import io.mifos.anubis.annotation.AcceptedTokenType;
+import io.mifos.anubis.annotation.Permittable;
+import io.mifos.permittedfeignclient.service.ApplicationPermissionRequirementsService;
+import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.*;
+
+/**
+ * @author Myrle Krantz
+ */
+@RestController
+@RequestMapping("/requiredpermissions")
+public class ApplicationPermissionRequirementsRestController {
+
+  private final ApplicationPermissionRequirementsService service;
+
+  @Autowired
+  public ApplicationPermissionRequirementsRestController(final ApplicationPermissionRequirementsService service) {
+    this.service = service;
+  }
+
+  @Permittable(AcceptedTokenType.GUEST)
+  @RequestMapping(
+      method = RequestMethod.GET,
+      consumes = MediaType.ALL_VALUE,
+      produces = MediaType.APPLICATION_JSON_VALUE
+  )
+  public
+  @ResponseBody
+  ResponseEntity<List<ApplicationPermission>> getRequiredPermissions() {
+    final List<ApplicationPermission> requiredPermissions = service.getRequiredPermissions();
+
+    return ResponseEntity.ok(new ArrayList<>(requiredPermissions));
+  }
+}
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java b/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
new file mode 100644
index 0000000..2f3c7e7
--- /dev/null
+++ b/library/src/main/java/io/mifos/permittedfeignclient/security/ApplicationTokenedTargetInterceptor.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.security;
+
+import feign.RequestInterceptor;
+import feign.RequestTemplate;
+import io.mifos.core.api.util.ApiConstants;
+import io.mifos.core.api.util.UserContext;
+import io.mifos.core.api.util.UserContextHolder;
+import io.mifos.permittedfeignclient.annotation.EndpointSet;
+import io.mifos.permittedfeignclient.service.ApplicationAccessTokenService;
+import org.springframework.util.Assert;
+
+import javax.annotation.Nonnull;
+
+/**
+ * @author Myrle Krantz
+ */
+public class ApplicationTokenedTargetInterceptor implements RequestInterceptor {
+  private final ApplicationAccessTokenService applicationAccessTokenService;
+  private final String endpointSetIdentifier;
+
+  public <T> ApplicationTokenedTargetInterceptor(
+          final @Nonnull ApplicationAccessTokenService applicationAccessTokenService,
+          final @Nonnull Class<T> type) {
+    Assert.notNull(applicationAccessTokenService);
+    Assert.notNull(type);
+
+    this.applicationAccessTokenService = applicationAccessTokenService;
+    final EndpointSet endpointSet = type.getAnnotation(EndpointSet.class);
+    Assert.notNull(endpointSet, "Permitted feign clients require an endpoint set identifier provided via @EndpointSet.");
+    this.endpointSetIdentifier = endpointSet.identifier();
+  }
+
+  @Override
+  public void apply(final RequestTemplate template) {
+    template.header(ApiConstants.AUTHORIZATION_HEADER, applicationAccessTokenService.getAccessToken(endpointSetIdentifier));
+    UserContextHolder.getUserContext()
+            .map(UserContext::getUser)
+            .ifPresent(user -> template.header(ApiConstants.USER_HEADER, user));
+  }
+}
\ No newline at end of file
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
new file mode 100644
index 0000000..b97b4dd
--- /dev/null
+++ b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenService.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.service;
+
+import io.mifos.anubis.config.TenantSignatureRepository;
+import io.mifos.anubis.security.AmitAuthenticationException;
+import io.mifos.anubis.token.TenantRefreshTokenSerializer;
+import io.mifos.anubis.token.TokenSerializationResult;
+import io.mifos.core.api.util.UserContextHolder;
+import io.mifos.core.lang.ApplicationName;
+import io.mifos.core.lang.TenantContextHolder;
+import io.mifos.core.lang.security.RsaKeyPairFactory;
+import io.mifos.identity.api.v1.client.IdentityManager;
+import io.mifos.identity.api.v1.domain.Authentication;
+import net.jodah.expiringmap.ExpirationPolicy;
+import net.jodah.expiringmap.ExpiringMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Nonnull;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author Myrle Krantz
+ */
+@Component
+public class ApplicationAccessTokenService {
+  private static final long REFRESH_TOKEN_LIFESPAN = TimeUnit.SECONDS.convert(1, TimeUnit.MINUTES);
+  private static class TokenCacheKey {
+    final String user;
+    final String tenant;
+    final String endpointSet;
+
+    private TokenCacheKey(final String user, final String tenant, final String endpointSet) {
+      this.user = user;
+      this.tenant = tenant;
+      this.endpointSet = endpointSet;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+      if (this == o) return true;
+      if (o == null || getClass() != o.getClass()) return false;
+      TokenCacheKey that = (TokenCacheKey) o;
+      return Objects.equals(user, that.user) &&
+              Objects.equals(tenant, that.tenant) &&
+              Objects.equals(endpointSet, that.endpointSet);
+    }
+
+    @Override
+    public int hashCode() {
+      return Objects.hash(user, tenant, endpointSet);
+    }
+
+    @Override
+    public String toString() {
+      return "TokenCacheKey{" +
+              "user='" + user + '\'' +
+              ", tenant='" + tenant + '\'' +
+              ", endpointSet='" + endpointSet + '\'' +
+              '}';
+    }
+  }
+
+  private final String applicationName;
+  private final TenantSignatureRepository tenantSignatureRepository;
+  private final IdentityManager identityManager;
+  private final TenantRefreshTokenSerializer tenantRefreshTokenSerializer;
+
+  private final Map<TokenCacheKey, TokenSerializationResult> refreshTokenCache;
+  private final Map<TokenCacheKey, Authentication> accessTokenCache;
+
+  @Autowired
+  public ApplicationAccessTokenService(
+          final @Nonnull ApplicationName applicationName,
+          final @Nonnull TenantSignatureRepository tenantSignatureRepository,
+          final @Nonnull IdentityManager identityManager,
+          final @Nonnull TenantRefreshTokenSerializer tenantRefreshTokenSerializer) {
+
+    this.applicationName = applicationName.toString();
+    this.tenantSignatureRepository = tenantSignatureRepository;
+    this.identityManager = identityManager;
+    this.tenantRefreshTokenSerializer = tenantRefreshTokenSerializer;
+
+    this.refreshTokenCache = ExpiringMap.builder()
+            .maxSize(300)
+            .expirationPolicy(ExpirationPolicy.CREATED)
+            .expiration(30, TimeUnit.SECONDS)
+            .entryLoader(tokenCacheKey -> this.createRefreshToken((TokenCacheKey)tokenCacheKey))
+            .build();
+    this.accessTokenCache = ExpiringMap.builder()
+            .maxSize(300)
+            .expirationPolicy(ExpirationPolicy.CREATED)
+            .expiration(30, TimeUnit.SECONDS)
+            .entryLoader(tokenCacheKey -> this.createAccessToken((TokenCacheKey)tokenCacheKey))
+            .build();
+  }
+
+  public String getAccessToken(final String endpointSetIdentifier) {
+    final TokenCacheKey tokenCacheKey
+            = new TokenCacheKey(UserContextHolder.checkedGetUser(), TenantContextHolder.checkedGetIdentifier(), endpointSetIdentifier);
+    final Authentication authentication = accessTokenCache.get(tokenCacheKey);
+    return authentication.getAccessToken();
+  }
+
+  private Authentication createAccessToken(final TokenCacheKey tokenCacheKey) {
+    final String refreshToken = refreshTokenCache.get(tokenCacheKey).getToken();
+    return identityManager.refresh(refreshToken);
+  }
+
+  private TokenSerializationResult createRefreshToken(final TokenCacheKey tokenCacheKey) {
+    final Optional<RsaKeyPairFactory.KeyPairHolder> optionalSigningKeyPair
+            = tenantSignatureRepository.getLatestApplicationSigningKeyPair();
+
+    final RsaKeyPairFactory.KeyPairHolder signingKeyPair = optionalSigningKeyPair.orElseThrow(AmitAuthenticationException::missingTenant);
+
+    final TenantRefreshTokenSerializer.Specification specification = new TenantRefreshTokenSerializer.Specification()
+            .setSourceApplication(applicationName)
+            .setUser(tokenCacheKey.user)
+            .setSecondsToLive(REFRESH_TOKEN_LIFESPAN)
+            .setPrivateKey(signingKeyPair.privateKey())
+            .setKeyTimestamp(signingKeyPair.getTimestamp())
+            .setEndpointSet(tokenCacheKey.endpointSet);
+
+    return tenantRefreshTokenSerializer.build(specification);
+  }
+}
diff --git a/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java
new file mode 100644
index 0000000..a0450d3
--- /dev/null
+++ b/library/src/main/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsService.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.service;
+
+import io.mifos.anubis.annotation.Permittable;
+import io.mifos.anubis.annotation.Permittables;
+import io.mifos.anubis.api.v1.domain.AllowedOperation;
+import io.mifos.identity.api.v1.domain.Permission;
+import io.mifos.permittedfeignclient.annotation.EndpointSet;
+import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * @author Myrle Krantz
+ */
+@Component
+public class ApplicationPermissionRequirementsService{
+  private final Class[] classes;
+
+  @Autowired
+  public ApplicationPermissionRequirementsService(final Class[] classes) {
+    this.classes = classes;
+  }
+
+  public List<ApplicationPermission> getRequiredPermissions() {
+    return Stream.of(classes)
+            .flatMap(ApplicationPermissionRequirementsService::getApplicationPermissionsFromInterface)
+            .collect(Collectors.toList());
+  }
+
+  static Stream<ApplicationPermission> getApplicationPermissionsFromInterface(
+          final Class permissionRequestedFeignInterface) {
+    final Map<String, List<Permission>> grouped = getPermissionsFromInterface(permissionRequestedFeignInterface)
+            .collect(Collectors.groupingBy(Permission::getPermittableEndpointGroupIdentifier));
+    return grouped.entrySet().stream().map(x -> getApplicationPermissionfromEntry(permissionRequestedFeignInterface, x));
+  }
+
+  private static <T>  ApplicationPermission getApplicationPermissionfromEntry(final Class<T> permissionRequestedFeignInterface,
+                                                                              final Map.Entry<String, List<Permission>> entry) {
+    final Optional<EndpointSet> permissionRequiredForAnnotation
+            = Optional.ofNullable(permissionRequestedFeignInterface.getAnnotation(EndpointSet.class));
+
+    final String permittableGroupId = permissionRequiredForAnnotation.map(EndpointSet::identifier)
+            .orElse(null);
+    final Permission permission = getPermissionfromEntry(entry);
+    return new ApplicationPermission(permittableGroupId, permission);
+  }
+
+  private static Permission getPermissionfromEntry(final Map.Entry<String, List<Permission>> entry) {
+    final Set<AllowedOperation> allowedOperations = entry.getValue().stream().flatMap(x -> x.getAllowedOperations().stream()).collect(Collectors.toSet());
+    return new Permission(entry.getKey(), allowedOperations);
+  }
+
+  private static Stream<Permission> getPermissionsFromInterface(final Class permissionRequestedFeignInterface) {
+    final Method[] methods = permissionRequestedFeignInterface.getMethods();
+    return Stream.of(methods)
+            .filter((method) -> method.isAnnotationPresent(Permittables.class) || method.isAnnotationPresent(Permittable.class))
+            .flatMap(ApplicationPermissionRequirementsService::extractPermissionsFromMethod);
+  }
+
+  static private Stream<Permission> extractPermissionsFromMethod(final Method method) {
+    final Permittables permittablesAnnotation = method.getAnnotation(Permittables.class);
+    final Permittable[] permittables;
+    if (permittablesAnnotation != null)
+      permittables = permittablesAnnotation.value();
+    else {
+      final Permittable permittableAnnotation = method.getAnnotation(Permittable.class);
+      permittables = new Permittable[]{permittableAnnotation};
+    }
+    return Stream.of(permittables)
+            .map(x -> mapPermittableToPermission(x, method));
+  }
+
+  static private Permission mapPermittableToPermission(final Permittable permittable,
+                                                                             final Method method) {
+    final RequestMapping requestMapping = method.getAnnotation(RequestMapping.class);
+    final RequestMethod[] httpMethods = requestMapping.method();
+
+    return new Permission(permittable.groupId(), mapMethodsToAllowedOperations(httpMethods));
+  }
+
+  static private Set<AllowedOperation> mapMethodsToAllowedOperations(final RequestMethod[] httpMethods) {
+    return Stream.of(httpMethods)
+            .map(ApplicationPermissionRequirementsService::mapRequestMethodToAllowedOperation)
+            .filter(Optional::isPresent)
+            .map(Optional::get)
+            .collect(Collectors.toSet());
+  }
+
+  static private Optional<AllowedOperation> mapRequestMethodToAllowedOperation(final RequestMethod requestMethod) {
+    switch (requestMethod) {
+      case GET:
+        return Optional.of(AllowedOperation.READ);
+      case HEAD:
+        return Optional.of(AllowedOperation.READ);
+      case POST:
+        return Optional.of(AllowedOperation.CHANGE);
+      case PUT:
+        return Optional.of(AllowedOperation.CHANGE);
+      case PATCH:
+        return Optional.of(AllowedOperation.CHANGE);
+      case DELETE:
+        return Optional.of(AllowedOperation.DELETE);
+      default:
+      case OPTIONS:
+      case TRACE:
+        return Optional.empty();
+    }
+  }
+}
\ No newline at end of file
diff --git a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
new file mode 100644
index 0000000..c940668
--- /dev/null
+++ b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationAccessTokenServiceTest.java
@@ -0,0 +1,62 @@
+package io.mifos.permittedfeignclient.service;
+
+import io.mifos.anubis.config.TenantSignatureRepository;
+import io.mifos.anubis.token.TenantRefreshTokenSerializer;
+import io.mifos.anubis.token.TokenSerializationResult;
+import io.mifos.core.api.context.AutoUserContext;
+import io.mifos.core.lang.ApplicationName;
+import io.mifos.core.lang.AutoTenantContext;
+import io.mifos.core.lang.security.RsaKeyPairFactory;
+import io.mifos.identity.api.v1.client.IdentityManager;
+import io.mifos.identity.api.v1.domain.Authentication;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import java.time.LocalDateTime;
+import java.util.Optional;
+
+/**
+ * @author Myrle Krantz
+ */
+public class ApplicationAccessTokenServiceTest {
+  private static final String APP_NAME = "app-v1";
+  private static final String BEARER_TOKEN_MOCK = "bearer token mock";
+  private static final String USER_NAME = "user";
+  private static final String TENANT_NAME = "tenant";
+  private static final String BEARER_INCOMING_ACCESS_TOKEN_MOCK = "bearer incoming access token mock";
+
+  @Test
+  public void testHappyCase() {
+    final ApplicationName applicationNameMock = Mockito.mock(ApplicationName.class);
+    Mockito.when(applicationNameMock.toString()).thenReturn(APP_NAME);
+
+    final TenantSignatureRepository tenantSignatureRepositoryMock = Mockito.mock(TenantSignatureRepository.class);
+    final Optional<RsaKeyPairFactory.KeyPairHolder> keyPair = Optional.of(RsaKeyPairFactory.createKeyPair());
+    Mockito.when(tenantSignatureRepositoryMock.getLatestApplicationSigningKeyPair()).thenReturn(keyPair);
+
+    final IdentityManager identityManagerMock = Mockito.mock(IdentityManager.class);
+    Mockito.when(identityManagerMock.refresh(Mockito.anyString()))
+            .thenReturn(new Authentication(BEARER_TOKEN_MOCK, "accesstokenexpiration", "refreshtokenexpiration", null));
+
+    final TenantRefreshTokenSerializer tenantRefreshTokenSerializerMock = Mockito.mock(TenantRefreshTokenSerializer.class);
+    Mockito.when(tenantRefreshTokenSerializerMock.build(Mockito.anyObject()))
+            .thenReturn(new TokenSerializationResult(BEARER_TOKEN_MOCK, LocalDateTime.now()));
+
+    final ApplicationAccessTokenService testSubject = new ApplicationAccessTokenService(
+            applicationNameMock,
+            tenantSignatureRepositoryMock,
+            identityManagerMock,
+            tenantRefreshTokenSerializerMock);
+
+    try (final AutoTenantContext ignored1 = new AutoTenantContext(TENANT_NAME)) {
+      try (final AutoUserContext ignored2 = new AutoUserContext(USER_NAME, BEARER_INCOMING_ACCESS_TOKEN_MOCK)) {
+        final String accessToken = testSubject.getAccessToken("blah");
+        Assert.assertEquals(BEARER_TOKEN_MOCK, accessToken);
+
+        final String accessTokenAgain = testSubject.getAccessToken("blah");
+        Assert.assertEquals(BEARER_TOKEN_MOCK, accessTokenAgain);
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java
new file mode 100644
index 0000000..1de7734
--- /dev/null
+++ b/library/src/test/java/io/mifos/permittedfeignclient/service/ApplicationPermissionRequirementsServiceTest.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2017 The Mifos Initiative.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.mifos.permittedfeignclient.service;
+
+import io.mifos.anubis.annotation.Permittable;
+import io.mifos.anubis.api.v1.domain.AllowedOperation;
+import io.mifos.identity.api.v1.domain.Permission;
+import io.mifos.permittedfeignclient.annotation.EndpointSet;
+import io.mifos.permittedfeignclient.api.v1.domain.ApplicationPermission;
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.cloud.netflix.feign.FeignClient;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.Collections;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * @author Myrle Krantz
+ */
+public class ApplicationPermissionRequirementsServiceTest {
+  @FeignClient
+  @EndpointSet(identifier = "z")
+  interface SampleWithPermissionRequiredFor {
+    @RequestMapping(method = RequestMethod.GET)
+    @Permittable(groupId = "x")
+    void getFoo();
+
+    @RequestMapping(method = RequestMethod.PUT)
+    @Permittable(groupId = "x")
+    @Permittable(groupId = "y")
+    void getBar();
+
+    @RequestMapping(method = RequestMethod.HEAD)
+    @Permittable(groupId = "m")
+    void headBar();
+
+    @RequestMapping(method = RequestMethod.DELETE)
+    @Permittable(groupId = "n")
+    void deleteBar();
+
+    @RequestMapping(method = RequestMethod.POST)
+    @Permittable(groupId = "o")
+    void postBar();
+
+    @RequestMapping(method = RequestMethod.PATCH)
+    @Permittable(groupId = "p")
+    void patchBar();
+  }
+
+  @Test
+  public void shouldReturnApplicationPermissionWithRequiredForPermittableGroup() throws Exception {
+    final ApplicationPermissionRequirementsService testSubject = new ApplicationPermissionRequirementsService(new Class[]{ SampleWithPermissionRequiredFor.class} );
+    final Set<ApplicationPermission> applicationPermissions =
+            testSubject.getRequiredPermissions().stream().collect(Collectors.toSet());
+
+    Assert.assertTrue(applicationPermissions.contains(new ApplicationPermission("z",
+            new Permission("x", Stream.of(AllowedOperation.READ, AllowedOperation.CHANGE).collect(Collectors.toSet())))));
+    Assert.assertTrue(applicationPermissions.contains(new ApplicationPermission("z",
+            new Permission("y", Collections.singleton(AllowedOperation.CHANGE)))));
+    Assert.assertTrue(applicationPermissions.contains(new ApplicationPermission("z",
+            new Permission("m", Collections.singleton(AllowedOperation.READ)))));
+    Assert.assertTrue(applicationPermissions.contains(new ApplicationPermission("z",
+            new Permission("n", Collections.singleton(AllowedOperation.DELETE)))));
+    Assert.assertTrue(applicationPermissions.contains(new ApplicationPermission("z",
+            new Permission("o", Collections.singleton(AllowedOperation.CHANGE)))));
+    Assert.assertTrue(applicationPermissions.contains(new ApplicationPermission("z",
+            new Permission("p", Collections.singleton(AllowedOperation.CHANGE)))));
+  }
+
+  @FeignClient
+  interface SampleWithoutPermissionRequiredFor {
+    @RequestMapping(method = RequestMethod.GET)
+    @Permittable(groupId = "x")
+    void getFoo();
+  }
+
+  @Test
+  public void shouldReturnApplicationPermissionWithoutRequiredForPermittableGroup() throws Exception {
+    final Set<ApplicationPermission> applicationPermissions =
+            ApplicationPermissionRequirementsService.getApplicationPermissionsFromInterface(SampleWithoutPermissionRequiredFor.class)
+                    .collect(Collectors.toSet());
+
+    Assert.assertTrue(applicationPermissions.contains(new ApplicationPermission(null,
+            new Permission("x", Collections.singleton(AllowedOperation.READ)))));
+  }
+
+}
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..f43e401
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,6 @@
+rootProject.name = 'permitted-feign-client'
+
+includeBuild 'api'
+includeBuild 'library'
+includeBuild 'another-for-test'
+includeBuild 'component-test'
diff --git a/shared.gradle b/shared.gradle
new file mode 100644
index 0000000..ca25a25
--- /dev/null
+++ b/shared.gradle
@@ -0,0 +1,79 @@
+group 'io.mifos.permitted-feign-client'
+version '0.1.0-BUILD-SNAPSHOT'
+
+apply plugin: 'java'
+apply plugin: 'idea'
+apply plugin: 'maven-publish'
+apply plugin: 'io.spring.dependency-management'
+
+
+ext.versions = [
+        frameworktest       : '0.1.0-BUILD-SNAPSHOT',
+        frameworkapi        : '0.1.0-BUILD-SNAPSHOT',
+        frameworkcassandra  : '0.1.0-BUILD-SNAPSHOT',
+        frameworklang       : '0.1.0-BUILD-SNAPSHOT',
+        frameworkidentity   : '0.1.0-BUILD-SNAPSHOT',
+        frameworkanubis     : '0.1.0-BUILD-SNAPSHOT',
+        frameworkservicestarter : '0.1.0-BUILD-SNAPSHOT',
+        jjwt                : '0.6.0',
+        hibernatevalidator  : '5.3.0.Final',
+        expiringmap         : '0.5.8'
+]
+
+tasks.withType(JavaCompile) {
+    sourceCompatibility = JavaVersion.VERSION_1_8
+    targetCompatibility = JavaVersion.VERSION_1_8
+}
+
+repositories {
+    jcenter()
+    mavenLocal()
+}
+
+configurations {
+    compile.exclude group: 'io.mifos.core', module: 'mariadb'
+    compile.exclude group: 'ch.vorburger', module: 'mariaDB4j'
+}
+
+dependencyManagement {
+    imports {
+        mavenBom 'io.spring.platform:platform-bom:Athens-RELEASE'
+        mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Camden.SR1'
+    }
+}
+
+// override certain dependency provided by Spring platform using newer releases
+ext['cassandra.version'] = '3.6'
+ext['cassandra-driver.version'] = '3.1.2'
+ext['activemq.version'] = '5.13.2'
+ext['spring-data-releasetrain.version'] = 'Gosling-SR2A'
+
+dependencies {
+    compile(
+            [group: 'com.google.code.findbugs', name: 'jsr305']
+    )
+
+    testCompile(
+            [group: 'org.springframework.boot', name: 'spring-boot-starter-test'],
+            [group: 'io.mifos.core', name: 'test', version: versions.frameworktest],
+    )
+}
+
+jar {
+    from sourceSets.main.allSource
+}
+
+license {
+    header rootProject.file('../HEADER')
+    strictCheck true
+    mapping {
+        java = 'SLASHSTAR_STYLE'
+        xml = 'XML_STYLE'
+        yml = 'SCRIPT_STYLE'
+        yaml = 'SCRIPT_STYLE'
+    }
+    ext.year = Calendar.getInstance().get(Calendar.YEAR)
+    ext.name = 'The Mifos Initiative'
+}
+
+task ci(dependsOn: ['clean', 'test', 'publish'])


[fineract-cn-permitted-feign-client] 07/27: Merge pull request #2 from myrle-krantz/develop

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 8e02dee3136a3d0994964295f0a3e8105d084f10
Merge: ddf2c42 752218b
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Tue May 23 09:25:36 2017 +0200

    Merge pull request #2 from myrle-krantz/develop
    
    changes to access token acquisition

 ...entConfiguration.java => LibraryConstants.java} | 12 +---
 .../config/PermittedFeignClientConfiguration.java  | 36 +++++++++-
 .../ApplicationTokenedTargetInterceptor.java       |  3 +-
 .../service/ApplicationAccessTokenService.java     | 78 ++++++++--------------
 .../service/TokenCacheKey.java                     | 72 ++++++++++++++++++++
 .../service/ApplicationAccessTokenServiceTest.java | 23 ++++++-
 6 files changed, 159 insertions(+), 65 deletions(-)


[fineract-cn-permitted-feign-client] 27/27: Merge pull request #5 from aasaru/artifactory

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit d7ad8706dfe1dcec4cb46ea7bcb9d74ab344a732
Merge: 6ec6c01 f02f997
Author: Awasum Yannick <aw...@apache.org>
AuthorDate: Tue Apr 30 09:17:25 2019 +0100

    Merge pull request #5 from aasaru/artifactory
    
    FINCN-148 build with travis-ci.com and upload artifacts to Artifactory

 .travis.yml                   | 30 ++++++++++++++++++
 README.md                     |  2 +-
 another-for-test/build.gradle |  5 +--
 api/build.gradle              |  3 +-
 build.gradle                  |  9 ++++++
 component-test/build.gradle   |  1 +
 library/build.gradle          |  3 +-
 shared.gradle                 | 17 +++++++++++
 travis.sh                     | 71 +++++++++++++++++++++++++++++++++++++++++++
 9 files changed, 136 insertions(+), 5 deletions(-)


[fineract-cn-permitted-feign-client] 15/27: Merge pull request #1 from myrle-krantz/develop

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 28e8752732fd2b56401a252f56c2738deb6ef800
Merge: 5dae487 38c1e0c
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Feb 26 18:34:01 2018 +0100

    Merge pull request #1 from myrle-krantz/develop
    
    updating artifact ids to apache fineract from mifos io

 another-for-test/build.gradle |  8 ++++----
 api/build.gradle              |  6 +++---
 build.gradle                  |  2 +-
 component-test/build.gradle   | 12 ++++++------
 library/build.gradle          | 12 ++++++------
 shared.gradle                 |  6 +++---
 6 files changed, 23 insertions(+), 23 deletions(-)


[fineract-cn-permitted-feign-client] 20/27: Merge pull request #3 from myrle-krantz/develop

Posted by aw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

awasum pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-permitted-feign-client.git

commit 060c11b8bf11682624427e4b54112ab9909efd99
Merge: e7721bf a064616
Author: Myrle Krantz <my...@apache.org>
AuthorDate: Mon Apr 9 22:02:25 2018 +0200

    Merge pull request #3 from myrle-krantz/develop
    
    Adding rat checks.

 another-for-test/build.gradle    | 18 ++++++++++++++++++
 another-for-test/settings.gradle | 17 +++++++++++++++++
 api/build.gradle                 | 18 ++++++++++++++++++
 api/settings.gradle              | 17 +++++++++++++++++
 build.gradle                     | 25 +++++++++++++++++++++++++
 component-test/build.gradle      | 18 ++++++++++++++++++
 component-test/settings.gradle   | 17 +++++++++++++++++
 library/build.gradle             | 18 ++++++++++++++++++
 library/settings.gradle          | 17 +++++++++++++++++
 settings.gradle                  | 17 +++++++++++++++++
 shared.gradle                    | 30 ++++++++++++++++++++++++++++++
 11 files changed, 212 insertions(+)