-
-
- -

-
-
-
diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/js/app.js b/examples/authz/photoz/photoz-html5-client/src/main/webapp/js/app.js
deleted file mode 100755
index 0a6bf48c2a..0000000000
--- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/js/app.js
+++ /dev/null
@@ -1,231 +0,0 @@
-var module = angular.module('photoz', ['ngRoute', 'ngResource']);
-
-var resourceServerId = 'photoz-restful-api';
-var apiUrl = window.location.origin + '/' + resourceServerId;
-
-angular.element(document).ready(function ($http) {
-    var keycloak = new Keycloak('keycloak.json');
-    keycloak.init({onLoad: 'login-required'}).success(function () {
-        console.log('User is now authenticated.');
-
-        module.factory('Identity', function () {
-            return new Identity(keycloak);
-        });
-
-        angular.bootstrap(document, ["photoz"]);
-    }).error(function () {
-        window.location.reload();
-    });
-});
-
-module.config(function ($httpProvider, $routeProvider) {
-    $httpProvider.interceptors.push('authInterceptor');
-    $routeProvider.when('/', {
-        templateUrl: 'partials/home.html',
-        controller: 'GlobalCtrl'
-    }).when('/album/create', {
-        templateUrl: 'partials/album/create.html',
-        controller: 'AlbumCtrl',
-    }).when('/album/:id', {
-        templateUrl: 'partials/album/detail.html',
-        controller: 'AlbumCtrl',
-    }).when('/admin/album', {
-        templateUrl: 'partials/admin/albums.html',
-        controller: 'AdminAlbumCtrl',
-    }).when('/profile', {
-        templateUrl: 'partials/profile.html',
-        controller: 'ProfileCtrl',
-    });
-});
-
-module.controller('GlobalCtrl', function ($scope, $http, $route, $location, Album, Identity) {
-    Album.query(function (albums) {
-        $scope.albums = albums;
-    });
-    Album.shares(function (albums) {
-        $scope.shares = albums;
-    });
-
-    $scope.Identity = Identity;
-
-    $scope.deleteAlbum = function (album) {
-        new Album(album).$delete({id: album.id}, function () {
-            $route.reload();
-        });
-    }
-
-    $scope.requestDeleteAccess = function (album) {
-        new Album(album).$delete({id: album.id}, function () {
-            // no-op
-        }, function () {
-            document.getElementById("output").innerHTML = 'Sent authorization request to resource owner, please, wait for approval.';
-        });
-    }
-
-    $scope.hasAccess = function (share, scope) {
-        for (i = 0; i < share.scopes.length; i++) {
-            if (share.scopes[i] == scope) {
-                return true;
-            }
-        }
-        return false;
-    }
-});
-
-module.controller('TokenCtrl', function ($scope, Identity) {
-    $scope.showRpt = function () {
-        document.getElementById("output").innerHTML = JSON.stringify(jwt_decode(Identity.authorization.rpt), null, '  ');
-    }
-
-    $scope.showAccessToken = function () {
-        document.getElementById("output").innerHTML = JSON.stringify(jwt_decode(Identity.authc.token), null, '  ');
-    }
-
-    $scope.requestEntitlements = function () {
-        Identity.authorization.entitlement('photoz-restful-api').then(function (rpt) {
-            $scope.showRpt()
-        });
-    }
-
-    $scope.Identity = Identity;
-});
-
-module.controller('AlbumCtrl', function ($scope, $http, $routeParams, $location, Album) {
-    $scope.album = {};
-    if ($routeParams.id) {
-        $scope.album = Album.get({id: $routeParams.id});
-    }
-    $scope.create = function () {
-        var newAlbum = new Album($scope.album);
-        newAlbum.$save({}, function (data) {
-            $location.path('/');
-        });
-    };
-    $scope.goto = function (path) {
-        $location.path(path)
-    }
-});
-
-module.controller('ProfileCtrl', function ($scope, $http, $routeParams, $location, Profile) {
-    $scope.profile = Profile.get();
-});
-
-module.controller('AdminAlbumCtrl', function ($scope, $http, $route, $location, AdminAlbum, Album) {
-    $scope.albums = {};
-    $http.get(apiUrl + '/admin/album').success(function (data) {
-        $scope.albums = data;
-    });
-    $scope.deleteAlbum = function (album) {
-        new Album(album).$delete({id: album.id}, function () {
-            $route.reload();
-        });
-    }
-});
-
-module.factory('Album', ['$resource', function ($resource) {
-    return $resource(apiUrl + '/album/:id', {id: '@id'}, {
-            shares: {url: apiUrl + '/album/shares', method: 'GET', isArray: true}
-        });
-}]);
-
-module.factory('Profile', ['$resource', function ($resource) {
-    return $resource(apiUrl + '/profile');
-}]);
-
-module.factory('AdminAlbum', ['$resource', function ($resource) {
-    return $resource(apiUrl + '/admin/album/:id');
-}]);
-
-module.factory('authInterceptor', function ($q, $injector, $timeout, Identity) {
-    return {
-        request: function (request) {
-            document.getElementById("output").innerHTML = '';
-            if (Identity.authorization && Identity.authorization.rpt && request.url.indexOf('/authorize') == -1) {
-                retries = 0;
-                request.headers.Authorization = 'Bearer ' + Identity.authorization.rpt;
-            } else {
-                request.headers.Authorization = 'Bearer ' + Identity.authc.token;
-            }
-            return request;
-        },
-        responseError: function (rejection) {
-            var status = rejection.status;
-
-            if (status == 403 || status == 401) {
-                var retry = (!rejection.config.retry ||  rejection.config.retry < 1);
-
-                if (!retry) {
-                    document.getElementById("output").innerHTML = 'You can not access or perform the requested operation on this resource.';
-                    return $q.reject(rejection);
-                }
-
-                if (rejection.config.url.indexOf('/authorize') == -1 && retry) {
-                    // here is the authorization logic, which tries to obtain an authorization token from the server in case the resource server
-                    // returns a 403 or 401.
-                    var wwwAuthenticateHeader = rejection.headers('WWW-Authenticate');
-
-                    // when using UMA, a WWW-Authenticate header should be returned by the resource server
-                    if (!wwwAuthenticateHeader) {
-                        return $q.reject(rejection);
-                    }
-
-                    // when using UMA, a WWW-Authenticate header should contain UMA data
-                    if (wwwAuthenticateHeader.indexOf('UMA') == -1) {
-                        return $q.reject(rejection);
-                    }
-
-                    var deferred = $q.defer();
-
-                    var params = wwwAuthenticateHeader.split(',');
-                    var ticket;
-
-                    // try to extract the permission ticket from the WWW-Authenticate header
-                    for (i = 0; i < params.length; i++) {
-                        var param = params[i].split('=');
-
-                        if (param[0] == 'ticket') {
-                            ticket = param[1].substring(1, param[1].length - 1).trim();
-                            break;
-                        }
-                    }
-
-                    // a permission ticket must exist in order to send an authorization request
-                    if (!ticket) {
-                        return $q.reject(rejection);
-                    }
-
-                    // prepare a authorization request with the permission ticket
-                    var authorizationRequest = {};
-                    authorizationRequest.ticket = ticket;
-
-                    // send the authorization request, if successful retry the request
-                    Identity.authorization.authorize(authorizationRequest).then(function (rpt) {
-                        deferred.resolve(rejection);
-                    }, function () {
-                        document.getElementById("output").innerHTML = 'You can not access or perform the requested operation on this resource.';
-                    }, function () {
-                        document.getElementById("output").innerHTML = 'Unexpected error from server.';
-                    });
-
-                    var promise = deferred.promise;
-
-                    return promise.then(function (res) {
-                        if (!res.config.retry) {
-                            res.config.retry = 1;
-                        } else {
-                            res.config.retry++;
-                        }
-
-                        var $http = $injector.get("$http");
-
-                        return $http(res.config).then(function (response) {
-                            return response;
-                        });
-                    });
-                }
-            }
-
-            return $q.reject(rejection);
-        }
-    };
-});
\ No newline at end of file
diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/js/identity.js b/examples/authz/photoz/photoz-html5-client/src/main/webapp/js/identity.js
deleted file mode 100644
index 4088f8075c..0000000000
--- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/js/identity.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *  Copyright 2016 Red Hat, Inc. and/or its affiliates
- *  and other contributors as indicated by the @author tags.
- *
- *  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.
- *
- */
-
-/**
- * Creates an Identity object holding the information obtained from the access token issued by Keycloak, after a successful authentication,
- * and a few utility methods to manage it.
- */
-(function (window, undefined) {
-    var Identity = function (keycloak) {
-        this.loggedIn = true;
-
-        this.claims = {};
-        this.claims.name = keycloak.idTokenParsed.name;
-
-        this.authc = {};
-        this.authc.token = keycloak.token;
-
-        this.logout = function () {
-            keycloak.logout();
-        };
-
-        this.account = function () {
-            keycloak.accountManagement();
-        }
-
-        this.hasRole = function (name) {
-            if (keycloak && keycloak.hasRealmRole(name)) {
-                return true;
-            }
-            return false;
-        };
-
-        this.isAdmin = function () {
-            return this.hasRole("admin");
-        };
-
-        this.authorization = new KeycloakAuthorization(keycloak);
-    }
-
-    if ( typeof module === "object" && module && typeof module.exports === "object" ) {
-        module.exports = Identity;
-    } else {
-        window.Identity = Identity;
-
-        if ( typeof define === "function" && define.amd ) {
-            define( "identity", [], function () { return Identity; } );
-        }
-    }
-})( window );
\ No newline at end of file
diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/keycloak.json b/examples/authz/photoz/photoz-html5-client/src/main/webapp/keycloak.json
deleted file mode 100644
index d9354e380a..0000000000
--- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/keycloak.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "realm": "photoz",
-  "auth-server-url" : "http://localhost:8180/auth",
-  "ssl-required" : "external",
-  "resource" : "photoz-html5-client",
-  "public-client" : true
-}
\ No newline at end of file
diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/lib/angular/angular-resource.min.js b/examples/authz/photoz/photoz-html5-client/src/main/webapp/lib/angular/angular-resource.min.js
deleted file mode 100644
index 3f196c3538..0000000000
--- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/lib/angular/angular-resource.min.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- AngularJS v1.3.0-beta.5
- (c) 2010-2014 Google, Inc. http://angularjs.org
- License: MIT
-*/
-(function(H,a,A){'use strict';function D(p,g){g=g||{};a.forEach(g,function(a,c){delete g[c]});for(var c in p)!p.hasOwnProperty(c)||"$"===c.charAt(0)&&"$"===c.charAt(1)||(g[c]=p[c]);return g}var v=a.$$minErr("$resource"),C=/^(\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/;a.module("ngResource",["ng"]).factory("$resource",["$http","$q",function(p,g){function c(a,c){this.template=a;this.defaults=c||{};this.urlParams={}}function t(n,w,l){function r(h,d){var e={};d=x({},w,d);s(d,function(b,d){u(b)&&(b=b());var k;if(b&&
-b.charAt&&"@"==b.charAt(0)){k=h;var a=b.substr(1);if(null==a||""===a||"hasOwnProperty"===a||!C.test("."+a))throw v("badmember",a);for(var a=a.split("."),f=0,c=a.length;f").append(b).html();try{return 3===b[0].nodeType?I(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,
-function(a,b){return"<"+I(b)})}catch(d){return I(c)}}function $b(b){try{return decodeURIComponent(b)}catch(a){}}function ac(b){var a={},c,d;q((b||"").split("&"),function(b){b&&(c=b.split("="),d=$b(c[0]),B(d)&&(b=B(c[1])?$b(c[1]):!0,a[d]?M(a[d])?a[d].push(b):a[d]=[a[d],b]:a[d]=b))});return a}function bc(b){var a=[];q(b,function(b,d){M(b)?q(b,function(b){a.push(Aa(d,!0)+(!0===b?"":"="+Aa(b,!0)))}):a.push(Aa(d,!0)+(!0===b?"":"="+Aa(b,!0)))});return a.length?a.join("&"):""}function Bb(b){return Aa(b,
-!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Aa(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,a?"%20":"+")}function ed(b,a){function c(a){a&&d.push(a)}var d=[b],e,g,f=["ng:app","ng-app","x-ng-app","data-ng-app"],h=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;q(f,function(a){f[a]=!0;c(U.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(q(b.querySelectorAll("."+a),c),q(b.querySelectorAll("."+
-a+"\\:"),c),q(b.querySelectorAll("["+a+"]"),c))});q(d,function(a){if(!e){var b=h.exec(" "+a.className+" ");b?(e=a,g=(b[2]||"").replace(/\s+/g,",")):q(a.attributes,function(b){!e&&f[b.name]&&(e=a,g=b.value)})}});e&&a(e,g?[g]:[])}function cc(b,a){var c=function(){b=y(b);if(b.injector()){var c=b[0]===U?"document":ha(b);throw Oa("btstrpd",c);}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");c=dc(a);c.invoke(["$rootScope","$rootElement","$compile","$injector","$animate",
-function(a,b,c,d,e){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},d=/^NG_DEFER_BOOTSTRAP!/;if(O&&!d.test(O.name))return c();O.name=O.name.replace(d,"");Qa.resumeBootstrap=function(b){q(b,function(b){a.push(b)});c()}}function ib(b,a){a=a||"_";return b.replace(fd,function(b,d){return(d?a:"")+b.toLowerCase()})}function Cb(b,a,c){if(!b)throw Oa("areq",a||"?",c||"required");return b}function Ra(b,a,c){c&&M(b)&&(b=b[b.length-1]);Cb(P(b),a,"not a function, got "+(b&&"object"==typeof b?
-b.constructor.name||"Object":typeof b));return b}function Ba(b,a){if("hasOwnProperty"===b)throw Oa("badname",a);}function ec(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,g=a.length,f=0;f")+d[2];for(d=d[0];d--;)c=c.lastChild;g=g.concat(sa.call(c.childNodes,void 0));c=e.firstChild;c.textContent=""}else g.push(a.createTextNode(b));e.textContent="";e.innerHTML="";q(g,function(a){e.appendChild(a)});return e}function N(b){if(b instanceof
-N)return b;t(b)&&(b=ca(b));if(!(this instanceof N)){if(t(b)&&"<"!=b.charAt(0))throw Hb("nosel");return new N(b)}if(t(b)){var a;a=U;var c;b=(c=ve.exec(b))?[a.createElement(c[1])]:(c=se(b,a))?c.childNodes:[]}kc(this,b)}function Ib(b){return b.cloneNode(!0)}function Ia(b){lc(b);var a=0;for(b=b.childNodes||[];a=T?(c.preventDefault=
-null,c.stopPropagation=null,c.isDefaultPrevented=null):(delete c.preventDefault,delete c.stopPropagation,delete c.isDefaultPrevented)};c.elem=b;return c}function Ja(b){var a=typeof b,c;"object"==a&&null!==b?"function"==typeof(c=b.$$hashKey)?c=b.$$hashKey():c===s&&(c=b.$$hashKey=eb()):c=b;return a+":"+c}function Wa(b){q(b,this.put,this)}function sc(b){var a,c;"function"==typeof b?(a=b.$inject)||(a=[],b.length&&(c=b.toString().replace(ye,""),c=c.match(ze),q(c[1].split(Ae),function(b){b.replace(Be,function(b,
-c,d){a.push(d)})})),b.$inject=a):M(b)?(c=b.length-1,Ra(b[c],"fn"),a=b.slice(0,c)):Ra(b,"fn",!0);return a}function dc(b){function a(a){return function(b,c){if(X(b))q(b,Ub(a));else return a(b,c)}}function c(a,b){Ba(a,"service");if(P(b)||M(b))b=n.instantiate(b);if(!b.$get)throw Xa("pget",a);return l[a+h]=b}function d(a,b){return c(a,{$get:b})}function e(a){var b=[],c,d,g,h;q(a,function(a){if(!k.get(a)){k.put(a,!0);try{if(t(a))for(c=Sa(a),b=b.concat(e(c.requires)).concat(c._runBlocks),d=c._invokeQueue,
-g=0,h=d.length;g 4096 bytes)!"));else{if(m.cookie!==da)for(da=m.cookie,d=da.split("; "),Q={},g=0;gk&&this.remove(p.key),b},get:function(a){if(k<
-Number.MAX_VALUE){var b=l[a];if(!b)return;e(b)}return m[a]},remove:function(a){if(k").parent()[0])});var g=L(a,b,a,c,d,e);ma(a,"ng-scope");return function(b,c,d){Cb(b,"scope");var e=c?Ka.clone.call(a):a;q(d,function(a,b){e.data("$"+b+"Controller",a)});d=0;for(var f=e.length;darguments.length&&(b=a,a=s);A&&(c=da);return p(a,b,c)}var J,x,w,G,R,E,da={},ob;J=c===g?d:Xb(d,new Kb(y(g),
-d.$attr));x=J.$$element;if(Q){var S=/^\s*([@=&])(\??)\s*(\w*)\s*$/;f=y(g);E=e.$new(!0);ia&&ia===Q.$$originalDirective?f.data("$isolateScope",E):f.data("$isolateScopeNoTemplate",E);ma(f,"ng-isolate-scope");q(Q.scope,function(a,c){var d=a.match(S)||[],g=d[3]||c,f="?"==d[2],d=d[1],m,l,n,p;E.$$isolateBindings[c]=d+g;switch(d){case "@":J.$observe(g,function(a){E[c]=a});J.$$observers[g].$$scope=e;J[g]&&(E[c]=b(J[g])(e));break;case "=":if(f&&!J[g])break;l=r(J[g]);p=l.literal?za:function(a,b){return a===
-b};n=l.assign||function(){m=E[c]=l(e);throw ja("nonassign",J[g],Q.name);};m=E[c]=l(e);E.$watch(function(){var a=l(e);p(a,E[c])||(p(a,m)?n(e,a=E[c]):E[c]=a);return m=a},null,l.literal);break;case "&":l=r(J[g]);E[c]=function(a){return l(e,a)};break;default:throw ja("iscp",Q.name,c,a);}})}ob=p&&z;L&&q(L,function(a){var b={$scope:a===Q||a.$$isolateScope?E:e,$element:x,$attrs:J,$transclude:ob},c;R=a.controller;"@"==R&&(R=J[a.name]);c=u(R,b);da[a.name]=c;A||x.data("$"+a.name+"Controller",c);a.controllerAs&&
-(b.$scope[a.controllerAs]=c)});f=0;for(w=m.length;fF.priority)break;if(V=F.scope)G=G||F,F.templateUrl||(I("new/isolated scope",Q,F,Z),X(V)&&(Q=F));v=F.name;!F.templateUrl&&F.controller&&(V=F.controller,L=L||{},I("'"+v+"' controller",L[v],F,Z),L[v]=F);if(V=F.transclude)D=!0,F.$$tlb||(I("transclusion",S,F,Z),S=F),"element"==V?(A=!0,w=F.priority,V=E(c,T,W),Z=d.$$element=y(U.createComment(" "+v+": "+d[v]+" ")),c=Z[0],pb(g,y(sa.call(V,0)),
-c),Ya=x(V,e,w,f&&f.name,{nonTlbTranscludeDirective:S})):(V=y(Ib(c)).contents(),Z.empty(),Ya=x(V,e));if(F.template)if(I("template",ia,F,Z),ia=F,V=P(F.template)?F.template(Z,d):F.template,V=Y(V),F.replace){f=F;V=Gb.test(V)?y(V):[];c=V[0];if(1!=V.length||1!==c.nodeType)throw ja("tplrt",v,"");pb(g,Z,c);oa={$attr:{}};V=da(c,[],oa);var $=a.splice(N+1,a.length-(N+1));Q&&tc(V);a=a.concat(V).concat($);B(d,oa);oa=a.length}else Z.html(V);if(F.templateUrl)I("template",ia,F,Z),ia=F,F.replace&&(f=F),H=C(a.splice(N,
-a.length-N),Z,d,g,Ya,m,n,{controllerDirectives:L,newIsolateScopeDirective:Q,templateDirective:ia,nonTlbTranscludeDirective:S}),oa=a.length;else if(F.compile)try{O=F.compile(Z,d,Ya),P(O)?z(null,O,T,W):O&&z(O.pre,O.post,T,W)}catch(aa){l(aa,ha(Z))}F.terminal&&(H.terminal=!0,w=Math.max(w,F.priority))}H.scope=G&&!0===G.scope;H.transclude=D&&Ya;p.hasElementTranscludeDirective=A;return H}function tc(a){for(var b=0,c=a.length;bp.priority)&&-1!=p.restrict.indexOf(g)&&(n&&(p=Wb(p,{$$start:n,$$end:r})),b.push(p),k=p)}catch(K){l(K)}}return k}function B(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;q(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});q(b,function(b,g){"class"==g?(ma(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==g?(e.attr("style",e.attr("style")+";"+b),a.style=
-(a.style?a.style+";":"")+b):"$"==g.charAt(0)||a.hasOwnProperty(g)||(a[g]=b,d[g]=c[g])})}function C(a,b,c,d,e,g,f,k){var m=[],l,r,u=b[0],z=a.shift(),K=A({},z,{templateUrl:null,transclude:null,replace:null,$$originalDirective:z}),x=P(z.templateUrl)?z.templateUrl(b,c):z.templateUrl;b.empty();n.get(w.getTrustedResourceUrl(x),{cache:p}).success(function(n){var p,H;n=Y(n);if(z.replace){n=Gb.test(n)?y(n):[];p=n[0];if(1!=n.length||1!==p.nodeType)throw ja("tplrt",z.name,x);n={$attr:{}};pb(d,b,p);var w=da(p,
-[],n);X(z.scope)&&tc(w);a=w.concat(a);B(c,n)}else p=u,b.html(n);a.unshift(K);l=ia(a,p,c,e,b,z,g,f,k);q(d,function(a,c){a==p&&(d[c]=b[0])});for(r=L(b[0].childNodes,e);m.length;){n=m.shift();H=m.shift();var G=m.shift(),R=m.shift(),w=b[0];if(H!==u){var E=H.className;k.hasElementTranscludeDirective&&z.replace||(w=Ib(p));pb(G,y(H),w);ma(y(w),E)}H=l.transclude?Q(n,l.transclude):R;l(r,n,w,d,H)}m=null}).error(function(a,b,c,d){throw ja("tpload",d.url);});return function(a,b,c,d,e){m?(m.push(b),m.push(c),
-m.push(d),m.push(e)):l(r,b,c,d,e)}}function D(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.namea.status?b:n.reject(b)}var d={method:"get",
-transformRequest:e.transformRequest,transformResponse:e.transformResponse},g=function(a){function b(a){var c;q(a,function(b,d){P(b)&&(c=b(),null!=c?a[d]=c:delete a[d])})}var c=e.headers,d=A({},a.headers),g,f,c=A({},c.common,c[I(a.method)]);b(c);b(d);a:for(g in c){a=I(g);for(f in d)if(I(f)===a)continue a;d[g]=c[g]}return d}(a);A(d,a);d.headers=g;d.method=Ga(d.method);(a=Lb(d.url)?b.cookies()[d.xsrfCookieName||e.xsrfCookieName]:s)&&(g[d.xsrfHeaderName||e.xsrfHeaderName]=a);var f=[function(a){g=a.headers;
-var b=yc(a.data,xc(g),a.transformRequest);D(a.data)&&q(g,function(a,b){"content-type"===I(b)&&delete g[b]});D(a.withCredentials)&&!D(e.withCredentials)&&(a.withCredentials=e.withCredentials);return u(a,b,g).then(c,c)},s],h=n.when(d);for(q(w,function(a){(a.request||a.requestError)&&f.unshift(a.request,a.requestError);(a.response||a.responseError)&&f.push(a.response,a.responseError)});f.length;){a=f.shift();var k=f.shift(),h=h.then(a,k)}h.success=function(a){h.then(function(b){a(b.data,b.status,b.headers,
-d)});return h};h.error=function(a){h.then(null,function(b){a(b.data,b.status,b.headers,d)});return h};return h}function u(b,c,g){function f(a,b,c,e){w&&(200<=a&&300>a?w.put(s,[a,b,wc(c),e]):w.remove(s));m(b,a,c,e);d.$$phase||d.$apply()}function m(a,c,d,e){c=Math.max(c,0);(200<=c&&300>c?p.resolve:p.reject)({data:a,status:c,headers:xc(d),config:b,statusText:e})}function k(){var a=gb(r.pendingRequests,b);-1!==a&&r.pendingRequests.splice(a,1)}var p=n.defer(),u=p.promise,w,q,s=z(b.url,b.params);r.pendingRequests.push(b);
-u.then(k,k);(b.cache||e.cache)&&(!1!==b.cache&&"GET"==b.method)&&(w=X(b.cache)?b.cache:X(e.cache)?e.cache:K);if(w)if(q=w.get(s),B(q)){if(q.then)return q.then(k,k),q;M(q)?m(q[1],q[0],ba(q[2]),q[3]):m(q,200,{},"OK")}else w.put(s,u);D(q)&&a(b.method,s,c,f,g,b.timeout,b.withCredentials,b.responseType);return u}function z(a,b){if(!b)return a;var c=[];ad(b,function(a,b){null===a||D(a)||(M(a)||(a=[a]),q(a,function(a){X(a)&&(a=ta(a));c.push(Aa(b)+"="+Aa(a))}))});0=T&&(!b.match(/^(get|post|head|put|delete|options)$/i)||!O.XMLHttpRequest))return new O.ActiveXObject("Microsoft.XMLHTTP");if(O.XMLHttpRequest)return new O.XMLHttpRequest;throw v("$httpBackend")("noxhr");}function ce(){this.$get=["$browser","$window","$document",function(b,a,c){return Fe(b,Ee,b.defer,a.angular.callbacks,c[0])}]}function Fe(b,a,c,d,e){function g(a,b,c){var g=e.createElement("script"),f=null;g.type="text/javascript";g.src=a;g.async=
-!0;f=function(a){Ua(g,"load",f);Ua(g,"error",f);e.body.removeChild(g);g=null;var h=-1,u="unknown";a&&("load"!==a.type||d[b].called||(a={type:"error"}),u=a.type,h="error"===a.type?404:200);c&&c(h,u)};qb(g,"load",f);qb(g,"error",f);e.body.appendChild(g);return f}var f=-1;return function(e,m,k,l,n,p,r,u){function z(){w=f;G&&G();x&&x.abort()}function K(a,d,e,g,f){L&&c.cancel(L);G=x=null;0===d&&(d=e?200:"file"==ua(m).protocol?404:0);a(1223===d?204:d,e,g,f||"");b.$$completeOutstandingRequest(C)}var w;b.$$incOutstandingRequestCount();
-m=m||b.url();if("jsonp"==I(e)){var H="_"+(d.counter++).toString(36);d[H]=function(a){d[H].data=a;d[H].called=!0};var G=g(m.replace("JSON_CALLBACK","angular.callbacks."+H),H,function(a,b){K(l,a,d[H].data,"",b);d[H]=C})}else{var x=a(e);x.open(e,m,!0);q(n,function(a,b){B(a)&&x.setRequestHeader(b,a)});x.onreadystatechange=function(){if(x&&4==x.readyState){var a=null,b=null;w!==f&&(a=x.getAllResponseHeaders(),b="response"in x?x.response:x.responseText);K(l,w||x.status,b,a,x.statusText||"")}};r&&(x.withCredentials=
-!0);if(u)try{x.responseType=u}catch(s){if("json"!==u)throw s;}x.send(k||null)}if(0=h&&(n.resolve(r),l(p.$$intervalId),delete e[p.$$intervalId]);u||b.$apply()},f);e[p.$$intervalId]=n;return p}var e={};d.cancel=function(a){return a&&a.$$intervalId in e?(e[a.$$intervalId].reject("canceled"),clearInterval(a.$$intervalId),delete e[a.$$intervalId],
-!0):!1};return d}]}function jd(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January February March April May June July August September October November December".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),
-DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return 1===b?"one":"other"}}}}function Ac(b){b=b.split("/");for(var a=b.length;a--;)b[a]=Bb(b[a]);return b.join("/")}function Bc(b,a,c){b=ua(b,c);a.$$protocol=
-b.protocol;a.$$host=b.hostname;a.$$port=Y(b.port)||Ge[b.protocol]||null}function Cc(b,a,c){var d="/"!==b.charAt(0);d&&(b="/"+b);b=ua(b,c);a.$$path=decodeURIComponent(d&&"/"===b.pathname.charAt(0)?b.pathname.substring(1):b.pathname);a.$$search=ac(b.search);a.$$hash=decodeURIComponent(b.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function pa(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function Za(b){var a=b.indexOf("#");return-1==a?b:b.substr(0,a)}function Mb(b){return b.substr(0,
-Za(b).lastIndexOf("/")+1)}function Dc(b,a){this.$$html5=!0;a=a||"";var c=Mb(b);Bc(b,this,b);this.$$parse=function(a){var e=pa(c,a);if(!t(e))throw Nb("ipthprfx",a,c);Cc(e,this,b);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=bc(this.$$search),b=this.$$hash?"#"+Bb(this.$$hash):"";this.$$url=Ac(this.$$path)+(a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)};this.$$rewrite=function(d){var e;if((e=pa(b,d))!==s)return d=e,(e=pa(a,e))!==s?c+(pa("/",e)||e):b+d;if((e=pa(c,
-d))!==s)return c+e;if(c==d+"/")return c}}function Ob(b,a){var c=Mb(b);Bc(b,this,b);this.$$parse=function(d){var e=pa(b,d)||pa(c,d),e="#"==e.charAt(0)?pa(a,e):this.$$html5?e:"";if(!t(e))throw Nb("ihshprfx",d,a);Cc(e,this,b);d=this.$$path;var g=/^\/?.*?:(\/.*)/;0===e.indexOf(b)&&(e=e.replace(b,""));g.exec(e)||(d=(e=g.exec(d))?e[1]:d);this.$$path=d;this.$$compose()};this.$$compose=function(){var c=bc(this.$$search),e=this.$$hash?"#"+Bb(this.$$hash):"";this.$$url=Ac(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=
-b+(this.$$url?a+this.$$url:"")};this.$$rewrite=function(a){if(Za(b)==Za(a))return a}}function Ec(b,a){this.$$html5=!0;Ob.apply(this,arguments);var c=Mb(b);this.$$rewrite=function(d){var e;if(b==Za(d))return d;if(e=pa(c,d))return b+a+e;if(c===d+"/")return c}}function rb(b){return function(){return this[b]}}function Fc(b,a){return function(c){if(D(c))return this[b];this[b]=a(c);this.$$compose();return this}}function de(){var b="",a=!1;this.hashPrefix=function(a){return B(a)?(b=a,this):b};this.html5Mode=
-function(b){return B(b)?(a=b,this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(c,d,e,g){function f(a){c.$broadcast("$locationChangeSuccess",h.absUrl(),a)}var h,m=d.baseHref(),k=d.url();a?(m=k.substring(0,k.indexOf("/",k.indexOf("//")+2))+(m||"/"),e=e.history?Dc:Ec):(m=Za(k),e=Ob);h=new e(m,"#"+b);h.$$parse(h.$$rewrite(k));g.on("click",function(a){if(!a.ctrlKey&&!a.metaKey&&2!=a.which){for(var b=y(a.target);"a"!==I(b[0].nodeName);)if(b[0]===g[0]||!(b=b.parent())[0])return;
-var e=b.prop("href");X(e)&&"[object SVGAnimatedString]"===e.toString()&&(e=ua(e.animVal).href);var f=h.$$rewrite(e);e&&(!b.attr("target")&&f&&!a.isDefaultPrevented())&&(a.preventDefault(),f!=d.url()&&(h.$$parse(f),c.$apply(),O.angular["ff-684208-preventDefault"]=!0))}});h.absUrl()!=k&&d.url(h.absUrl(),!0);d.onUrlChange(function(a){h.absUrl()!=a&&(c.$evalAsync(function(){var b=h.absUrl();h.$$parse(a);c.$broadcast("$locationChangeStart",a,b).defaultPrevented?(h.$$parse(b),d.url(b)):f(b)}),c.$$phase||
-c.$digest())});var l=0;c.$watch(function(){var a=d.url(),b=h.$$replace;l&&a==h.absUrl()||(l++,c.$evalAsync(function(){c.$broadcast("$locationChangeStart",h.absUrl(),a).defaultPrevented?h.$$parse(a):(d.url(h.absUrl(),b),f(a))}));h.$$replace=!1;return l});return h}]}function ee(){var b=!0,a=this;this.debugEnabled=function(a){return B(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:
-a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||C;a=!1;try{a=!!e.apply}catch(m){}return a?function(){var a=[];q(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function fa(b,a){if("constructor"===b)throw Ca("isecfld",a);return b}function $a(b,
-a){if(b){if(b.constructor===b)throw Ca("isecfn",a);if(b.document&&b.location&&b.alert&&b.setInterval)throw Ca("isecwindow",a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw Ca("isecdom",a);}return b}function sb(b,a,c,d,e){e=e||{};a=a.split(".");for(var g,f=0;1e?Gc(d[0],d[1],d[2],d[3],d[4],c,a):function(b,g){var f=0,h;do h=Gc(d[f++],d[f++],d[f++],d[f++],d[f++],c,a)(b,g),g=s,b=h;while(fa)for(b in k++,e)e.hasOwnProperty(b)&&!d.hasOwnProperty(b)&&(q--,delete e[b])}else e!==d&&(e=d,k++);return k},function(){p?(p=!1,b(d,d,c)):b(d,f,c);if(h)if(X(d))if(db(d)){f=Array(d.length);for(var a=0;as&&(y=4-s,Q[y]||(Q[y]=[]),E=P(d.exp)?"fn: "+(d.exp.name||d.exp.toString()):d.exp,E+="; newVal: "+ta(g)+"; oldVal: "+ta(f),Q[y].push(E));else if(d===c){x=!1;break a}}catch(t){p.$$phase=
-null,e(t)}if(!(h=L.$$childHead||L!==this&&L.$$nextSibling))for(;L!==this&&!(h=L.$$nextSibling);)L=L.$parent}while(L=h);if((x||k.length)&&!s--)throw p.$$phase=null,a("infdig",b,ta(Q));}while(x||k.length);for(p.$$phase=null;l.length;)try{l.shift()()}catch(S){e(S)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this!==p&&(q(this.$$listenerCount,hb(null,l,this)),a.$$childHead==this&&(a.$$childHead=this.$$nextSibling),a.$$childTail==this&&
-(a.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=null,this.$$listeners={},this.$$watchers=this.$$asyncQueue=this.$$postDigestQueue=[],this.$destroy=this.$digest=this.$apply=C,this.$on=this.$watch=function(){return C})}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a){p.$$phase||
-p.$$asyncQueue.length||f.defer(function(){p.$$asyncQueue.length&&p.$digest()});this.$$asyncQueue.push({scope:this,expression:a})},$$postDigest:function(a){this.$$postDigestQueue.push(a)},$apply:function(a){try{return m("$apply"),this.$eval(a)}catch(b){e(b)}finally{p.$$phase=null;try{p.$digest()}catch(c){throw e(c),c;}}},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);
-var e=this;return function(){c[gb(c,b)]=null;l(e,1,a)}},$emit:function(a,b){var c=[],d,g=this,f=!1,h={name:a,targetScope:g,stopPropagation:function(){f=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=[h].concat(sa.call(arguments,1)),m,l;do{d=g.$$listeners[a]||c;h.currentScope=g;m=0;for(l=d.length;mc.msieDocumentMode)throw wa("iequirks");var e=ba(ga);e.isEnabled=function(){return b};e.trustAs=d.trustAs;e.getTrusted=d.getTrusted;e.valueOf=d.valueOf;b||(e.trustAs=e.getTrusted=function(a,b){return b},e.valueOf=Ea);e.parseAs=function(b,c){var d=a(c);return d.literal&&d.constant?d:function(a,c){return e.getTrusted(b,
-d(a,c))}};var g=e.parseAs,f=e.getTrusted,h=e.trustAs;q(ga,function(a,b){var c=I(b);e[Ta("parse_as_"+c)]=function(b){return g(a,b)};e[Ta("get_trusted_"+c)]=function(b){return f(a,b)};e[Ta("trust_as_"+c)]=function(b){return h(a,b)}});return e}]}function ke(){this.$get=["$window","$document",function(b,a){var c={},d=Y((/android (\d+)/.exec(I((b.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||{}).userAgent),g=a[0]||{},f=g.documentMode,h,m=/^(Moz|webkit|O|ms)(?=[A-Z])/,k=g.body&&g.body.style,
-l=!1,n=!1;if(k){for(var p in k)if(l=m.exec(p)){h=l[0];h=h.substr(0,1).toUpperCase()+h.substr(1);break}h||(h="WebkitOpacity"in k&&"webkit");l=!!("transition"in k||h+"Transition"in k);n=!!("animation"in k||h+"Animation"in k);!d||l&&n||(l=t(g.body.style.webkitTransition),n=t(g.body.style.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hashchange:"onhashchange"in b&&(!f||7b;b=Math.abs(b);var f=b+"",h="",m=[],k=!1;if(-1!==f.indexOf("e")){var l=f.match(/([\d\.]+)e(-?)(\d+)/);l&&"-"==l[2]&&l[3]>e+1?f="0":(h=f,k=!0)}if(k)0b)&&(h=b.toFixed(e));
-else{f=(f.split(Rc)[1]||"").length;D(e)&&(e=Math.min(Math.max(a.minFrac,f),a.maxFrac));f=Math.pow(10,e);b=Math.round(b*f)/f;b=(""+b).split(Rc);f=b[0];b=b[1]||"";var l=0,n=a.lgSize,p=a.gSize;if(f.length>=n+p)for(l=f.length-n,k=0;kb&&(d="-",b=-b);for(b=""+b;b.length-c)e+=c;0===e&&-12==c&&(e=12);return tb(e,a,d)}}function ub(b,a){return function(c,d){var e=c["get"+b](),g=Ga(a?"SHORT"+b:b);return d[g][e]}}function Sc(b){var a=(new Date(b,0,1)).getDay();return new Date(b,0,(4>=a?5:12)-a)}function Tc(b){return function(a){var c=Sc(a.getFullYear());a=+new Date(a.getFullYear(),a.getMonth(),a.getDate()+
-(4-a.getDay()))-+c;a=1+Math.round(a/6048E5);return tb(a,b)}}function Nc(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var g=0,f=0,h=b[8]?a.setUTCFullYear:a.setFullYear,m=b[8]?a.setUTCHours:a.setHours;b[9]&&(g=Y(b[9]+b[10]),f=Y(b[9]+b[11]));h.call(a,Y(b[1]),Y(b[2])-1,Y(b[3]));g=Y(b[4]||0)-g;f=Y(b[5]||0)-f;h=Y(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));m.call(a,g,f,h,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
-return function(c,e){var g="",f=[],h,m;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;t(c)&&(c=Qe.test(c)?Y(c):a(c));Ab(c)&&(c=new Date(c));if(!ra(c))return c;for(;e;)(m=Re.exec(e))?(f=f.concat(sa.call(m,1)),e=f.pop()):(f.push(e),e=null);q(f,function(a){h=Se[a];g+=h?h(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function Me(){return function(b){return ta(b,!0)}}function Ne(){return function(b,a){if(!M(b)&&!t(b))return b;a=Y(a);if(t(b))return a?0<=a?b.slice(0,a):b.slice(a,
-b.length):"";var c=[],d,e;a>b.length?a=b.length:a<-b.length&&(a=-b.length);0a||37<=a&&40>=a)||l()});if(e.hasEvent("paste"))a.on("paste cut",l)}a.on("change",m);d.$render=function(){a.val(d.$isEmpty(d.$viewValue)?"":d.$viewValue)};var n=c.ngPattern;n&&((e=n.match(/^\/(.*)\/([gim]*)$/))?(n=RegExp(e[1],e[2]),e=function(a){return qa(d,"pattern",d.$isEmpty(a)||n.test(a),a)}):e=function(c){var e=b.$eval(n);if(!e||!e.test)throw v("ngPattern")("noregexp",n,
-e,ha(a));return qa(d,"pattern",d.$isEmpty(c)||e.test(c),c)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){var p=Y(c.ngMinlength);e=function(a){return qa(d,"minlength",d.$isEmpty(a)||a.length>=p,a)};d.$parsers.push(e);d.$formatters.push(e)}if(c.ngMaxlength){var r=Y(c.ngMaxlength);e=function(a){return qa(d,"maxlength",d.$isEmpty(a)||a.length<=r,a)};d.$parsers.push(e);d.$formatters.push(e)}}function zb(b,a){return function(c){var d;return ra(c)?c:t(c)&&(b.lastIndex=0,c=b.exec(c))?(c.shift(),
-d={yyyy:0,MM:1,dd:1,HH:0,mm:0},q(c,function(b,c){c=c(f.min);h.$setValidity("min",b);return b?a:
-s},h.$parsers.push(e),h.$formatters.push(e));f.max&&(e=function(a){var b=h.$isEmpty(a)||c(a)<=c(f.max);h.$setValidity("max",b);return b?a:s},h.$parsers.push(e),h.$formatters.push(e))}}function Rb(b,a){b="ngClass"+b;return["$animate",function(c){function d(a,b){var c=[],d=0;a:for(;dT?function(b){b=b.nodeName?b:b[0];return b.scopeName&&"HTML"!=b.scopeName?Ga(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var fd=/[A-Z]/g,id={full:"1.3.0-beta.5",major:1,minor:3,dot:0,codeName:"chimeric-glitterfication"},Va=N.cache={},jb=N.expando="ng-"+
-(new Date).getTime(),we=1,qb=O.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},Ua=O.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)};N._data=function(b){return this.cache[b[this.expando]]||{}};var qe=/([\:\-\_]+(.))/g,re=/^moz([A-Z])/,Hb=v("jqLite"),ve=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Gb=/<|&#?\w+;/,te=/<([\w:]+)/,ue=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
-ea={option:[1,'"],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ea.optgroup=ea.option;ea.tbody=ea.tfoot=ea.colgroup=ea.caption=ea.thead;ea.th=ea.td;var Ka=N.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===U.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),N(O).on("load",a))}, -toString:function(){var b=[];q(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=b?y(this[b]):y(this[this.length+b])},length:0,push:Ue,sort:[].sort,splice:[].splice},nb={};q("multiple selected checked disabled readOnly required open".split(" "),function(b){nb[I(b)]=b});var rc={};q("input select option textarea button form details".split(" "),function(b){rc[Ga(b)]=!0});q({data:nc,inheritedData:mb,scope:function(b){return y(b).data("$scope")||mb(b.parentNode||b,["$isolateScope", -"$scope"])},isolateScope:function(b){return y(b).data("$isolateScope")||y(b).data("$isolateScopeNoTemplate")},controller:oc,injector:function(b){return mb(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Jb,css:function(b,a,c){a=Ta(a);if(B(c))b.style[a]=c;else{var d;8>=T&&(d=b.currentStyle&&b.currentStyle[a],""===d&&(d="auto"));d=d||b.style[a];8>=T&&(d=""===d?s:d);return d}},attr:function(b,a,c){var d=I(a);if(nb[d])if(B(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d)); -else return b[a]||(b.attributes.getNamedItem(a)||C).specified?d:s;else if(B(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?s:b},prop:function(b,a,c){if(B(c))b[a]=c;else return b[a]},text:function(){function b(b,d){var e=a[b.nodeType];if(D(d))return e?b[e]:"";b[e]=d}var a=[];9>T?(a[1]="innerText",a[3]="nodeValue"):a[1]=a[3]="textContent";b.$dv="";return b}(),val:function(b,a){if(D(a)){if("SELECT"===La(b)&&b.multiple){var c=[];q(b.options,function(a){a.selected&& -c.push(a.value||a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(D(a))return b.innerHTML;for(var c=0,d=b.childNodes;c":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Xe={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'}, -Qb=function(a){this.options=a};Qb.prototype={constructor:Qb,lex:function(a){this.text=a;this.index=0;this.ch=s;this.lastCh=":";this.tokens=[];var c;for(a=[];this.index=a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"=== -a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=B(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw Ca("lexerr",a,c,this.text);},readNumber:function(){for(var a="",c=this.index;this.index","<=",">="))a=this.binaryFn(a,c.fn,this.relational());return a},additive:function(){for(var a=this.multiplicative(),c;c=this.expect("+","-");)a=this.binaryFn(a,c.fn,this.multiplicative());return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a=this.binaryFn(a,c.fn,this.unary());return a},unary:function(){var a;return this.expect("+")?this.primary():(a=this.expect("-"))?this.binaryFn(ab.ZERO,a.fn, -this.unary()):(a=this.expect("!"))?this.unaryFn(a.fn,this.unary()):this.primary()},fieldAccess:function(a){var c=this,d=this.expect().text,e=Hc(d,this.options,this.text);return A(function(c,d,h){return e(h||a(c,d))},{assign:function(e,f,h){return sb(a(e,h),d,f,c.text,c.options)}})},objectIndex:function(a){var c=this,d=this.expression();this.consume("]");return A(function(e,g){var f=a(e,g),h=d(e,g),m;if(!f)return s;(f=$a(f[h],c.text))&&(f.then&&c.options.unwrapPromises)&&(m=f,"$$v"in f||(m.$$v=s,m.then(function(a){m.$$v= -a})),f=f.$$v);return f},{assign:function(e,g,f){var h=d(e,f);return $a(a(e,f),c.text)[h]=g}})},functionCall:function(a,c){var d=[];if(")"!==this.peekToken().text){do d.push(this.expression());while(this.expect(","))}this.consume(")");var e=this;return function(g,f){for(var h=[],m=c?c(g,f):g,k=0;ka.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=-1*a.getTimezoneOffset();return a=(0<=a?"+":"")+(tb(Math[0=T&&(c.href||c.name||c.$set("href",""),a.append(U.createComment("IE fix")));if(!c.href&&!c.xlinkHref&&!c.name)return function(a,c){var g="[object SVGAnimatedString]"===ya.call(c.prop("href"))?"xlink:href":"href";c.on("click",function(a){c.attr(g)||a.preventDefault()})}}}),Eb={};q(nb,function(a,c){if("multiple"!=a){var d=na("ng-"+c);Eb[d]=function(){return{priority:100,link:function(a,g,f){a.$watch(f[d],function(a){f.$set(c, -!!a)})}}}}});q(["src","srcset","href"],function(a){var c=na("ng-"+a);Eb[c]=function(){return{priority:99,link:function(d,e,g){var f=a,h=a;"href"===a&&"[object SVGAnimatedString]"===ya.call(e.prop("href"))&&(h="xlinkHref",g.$attr[h]="xlink:href",f=null);g.$observe(c,function(a){a&&(g.$set(h,a),T&&f&&e.prop(f,g[h]))})}}}});var xb={$addControl:C,$removeControl:C,$setValidity:C,$setDirty:C,$setPristine:C};Uc.$inject=["$element","$attrs","$scope","$animate"];var Vc=function(a){return["$timeout",function(c){return{name:"form", -restrict:a?"EAC":"E",controller:Uc,compile:function(){return{pre:function(a,e,g,f){if(!g.action){var h=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};qb(e[0],"submit",h);e.on("$destroy",function(){c(function(){Ua(e[0],"submit",h)},0,!1)})}var m=e.parent().controller("form"),k=g.name||g.ngForm;k&&sb(a,k,f,k);if(m)e.on("$destroy",function(){m.$removeControl(f);k&&sb(a,k,s,k);A(f,xb)})}}}}}]},md=Vc(),zd=Vc(!0),Ye=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/, -Ze=/^[a-z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*$/i,$e=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Wc=/^(\d{4})-(\d{2})-(\d{2})$/,Xc=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)$/,Sb=/^(\d{4})-W(\d\d)$/,Yc=/^(\d{4})-(\d\d)$/,Zc=/^(\d\d):(\d\d)$/,$c={text:bb,date:cb("date",Wc,zb(Wc,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":cb("datetimelocal",Xc,zb(Xc,["yyyy","MM","dd","HH","mm"]),"yyyy-MM-ddTHH:mm"),time:cb("time",Zc,zb(Zc,["HH","mm"]),"HH:mm"),week:cb("week",Sb,function(a){if(ra(a))return a; -if(t(a)){Sb.lastIndex=0;var c=Sb.exec(a);if(c){a=+c[1];var d=+c[2],c=Sc(a),d=7*(d-1);return new Date(a,0,c.getDate()+d)}}return NaN},"yyyy-Www"),month:cb("month",Yc,zb(Yc,["yyyy","MM"]),"yyyy-MM"),number:function(a,c,d,e,g,f){bb(a,c,d,e,g,f);e.$parsers.push(function(a){var c=e.$isEmpty(a);if(c||$e.test(a))return e.$setValidity("number",!0),""===a?null:c?a:parseFloat(a);e.$setValidity("number",!1);return s});Te(e,"number",c);e.$formatters.push(function(a){return e.$isEmpty(a)?"":""+a});d.min&&(a=function(a){var c= -parseFloat(d.min);return qa(e,"min",e.$isEmpty(a)||a>=c,a)},e.$parsers.push(a),e.$formatters.push(a));d.max&&(a=function(a){var c=parseFloat(d.max);return qa(e,"max",e.$isEmpty(a)||a<=c,a)},e.$parsers.push(a),e.$formatters.push(a));e.$formatters.push(function(a){return qa(e,"number",e.$isEmpty(a)||Ab(a),a)})},url:function(a,c,d,e,g,f){bb(a,c,d,e,g,f);a=function(a){return qa(e,"url",e.$isEmpty(a)||Ye.test(a),a)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,g,f){bb(a,c,d,e,g,f); -a=function(a){return qa(e,"email",e.$isEmpty(a)||Ze.test(a),a)};e.$formatters.push(a);e.$parsers.push(a)},radio:function(a,c,d,e){D(d.name)&&c.attr("name",eb());c.on("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var g=d.ngTrueValue,f=d.ngFalseValue;t(g)||(g=!0);t(f)||(f=!1);c.on("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})}); -e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return a!==g};e.$formatters.push(function(a){return a===g});e.$parsers.push(function(a){return a?g:f})},hidden:C,button:C,submit:C,reset:C,file:C},gc=["$browser","$sniffer","$filter",function(a,c,d){return{restrict:"E",require:"?ngModel",link:function(e,g,f,h){h&&($c[I(f.type)]||$c.text)(e,g,f,h,c,a,d)}}}],wb="ng-valid",vb="ng-invalid",Ma="ng-pristine",yb="ng-dirty",af=["$scope","$exceptionHandler","$attrs","$element","$parse", -"$animate",function(a,c,d,e,g,f){function h(a,c){c=c?"-"+ib(c,"-"):"";f.removeClass(e,(a?vb:wb)+c);f.addClass(e,(a?wb:vb)+c)}this.$modelValue=this.$viewValue=Number.NaN;this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var m=g(d.ngModel),k=m.assign;if(!k)throw v("ngModel")("nonassign",d.ngModel,ha(e));this.$render=C;this.$isEmpty=function(a){return D(a)||""===a||null===a||a!==a};var l=e.inheritedData("$formController")|| -xb,n=0,p=this.$error={};e.addClass(Ma);h(!0);this.$setValidity=function(a,c){p[a]!==!c&&(c?(p[a]&&n--,n||(h(!0),this.$valid=!0,this.$invalid=!1)):(h(!1),this.$invalid=!0,this.$valid=!1,n++),p[a]=!c,h(c,a),l.$setValidity(a,c,this))};this.$setPristine=function(){this.$dirty=!1;this.$pristine=!0;f.removeClass(e,yb);f.addClass(e,Ma)};this.$setViewValue=function(d){this.$viewValue=d;this.$pristine&&(this.$dirty=!0,this.$pristine=!1,f.removeClass(e,Ma),f.addClass(e,yb),l.$setDirty());q(this.$parsers,function(a){d= -a(d)});this.$modelValue!==d&&(this.$modelValue=d,k(a,d),q(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}}))};var r=this;a.$watch(function(){var c=m(a);if(r.$modelValue!==c){var d=r.$formatters,e=d.length;for(r.$modelValue=c;e--;)c=d[e](c);r.$viewValue!==c&&(r.$viewValue=c,r.$render())}return c})}],Od=function(){return{require:["ngModel","^?form"],controller:af,link:function(a,c,d,e){var g=e[0],f=e[1]||xb;f.$addControl(g);a.$on("$destroy",function(){f.$removeControl(g)})}}},Qd=aa({require:"ngModel", -link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),hc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var g=function(a){if(d.required&&e.$isEmpty(a))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(g);e.$parsers.unshift(g);d.$observe("required",function(){g(e.$viewValue)})}}}},Pd=function(){return{require:"ngModel",link:function(a,c,d,e){var g=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])|| -d.ngList||",";e.$parsers.push(function(a){if(!D(a)){var c=[];a&&q(a.split(g),function(a){a&&c.push(ca(a))});return c}});e.$formatters.push(function(a){return M(a)?a.join(", "):s});e.$isEmpty=function(a){return!a||!a.length}}}},bf=/^(true|false|\d+)$/,Rd=function(){return{priority:100,compile:function(a,c){return bf.test(c.ngValue)?function(a,c,g){g.$set("value",a.$eval(g.ngValue))}:function(a,c,g){a.$watch(g.ngValue,function(a){g.$set("value",a)})}}}},rd=xa(function(a,c,d){c.addClass("ng-binding").data("$binding", -d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==s?"":a)})}),td=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],sd=["$sce","$parse",function(a,c){return function(d,e,g){e.addClass("ng-binding").data("$binding",g.ngBindHtml);var f=c(g.ngBindHtml);d.$watch(function(){return(f(d)||"").toString()},function(c){e.html(a.getTrustedHtml(f(d))||"")})}}],ud=Rb("",!0),wd= -Rb("Odd",0),vd=Rb("Even",1),xd=xa({compile:function(a,c){c.$set("ngCloak",s);a.removeClass("ng-cloak")}}),yd=[function(){return{scope:!0,controller:"@",priority:500}}],ic={};q("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var c=na("ng-"+a);ic[c]=["$parse",function(d){return{compile:function(e,g){var f=d(g[c]);return function(c,d,e){d.on(I(a),function(a){c.$apply(function(){f(c,{$event:a})})})}}}}]}); -var Bd=["$animate",function(a){return{transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,g,f){var h,m,k;c.$watch(e.ngIf,function(g){Pa(g)?m||(m=c.$new(),f(m,function(c){c[c.length++]=U.createComment(" end ngIf: "+e.ngIf+" ");h={clone:c};a.enter(c,d.parent(),d)})):(k&&(k.remove(),k=null),m&&(m.$destroy(),m=null),h&&(k=Db(h.clone),a.leave(k,function(){k=null}),h=null))})}}}],Cd=["$http","$templateCache","$anchorScroll","$animate","$sce",function(a,c,d,e,g){return{restrict:"ECA", -priority:400,terminal:!0,transclude:"element",controller:Qa.noop,compile:function(f,h){var m=h.ngInclude||h.src,k=h.onload||"",l=h.autoscroll;return function(f,h,r,q,z){var s=0,w,y,G,x=function(){y&&(y.remove(),y=null);w&&(w.$destroy(),w=null);G&&(e.leave(G,function(){y=null}),y=G,G=null)};f.$watch(g.parseAsResourceUrl(m),function(g){var m=function(){!B(l)||l&&!f.$eval(l)||d()},r=++s;g?(a.get(g,{cache:c}).success(function(a){if(r===s){var c=f.$new();q.template=a;a=z(c,function(a){x();e.enter(a,null, -h,m)});w=c;G=a;w.$emit("$includeContentLoaded");f.$eval(k)}}).error(function(){r===s&&x()}),f.$emit("$includeContentRequested")):(x(),q.template=null)})}}}}],Sd=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,g){d.html(g.template);a(d.contents())(c)}}}],Dd=xa({priority:450,compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Ed=xa({terminal:!0,priority:1E3}),Fd=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA", -link:function(e,g,f){var h=f.count,m=f.$attr.when&&g.attr(f.$attr.when),k=f.offset||0,l=e.$eval(m)||{},n={},p=c.startSymbol(),r=c.endSymbol(),s=/^when(Minus)?(.+)$/;q(f,function(a,c){s.test(c)&&(l[I(c.replace("when","").replace("Minus","-"))]=g.attr(f.$attr[c]))});q(l,function(a,e){n[e]=c(a.replace(d,p+h+"-"+k+r))});e.$watch(function(){var c=parseFloat(e.$eval(h));if(isNaN(c))return"";c in l||(c=a.pluralCat(c-k));return n[c](e,g,!0)},function(a){g.text(a)})}}}],Gd=["$parse","$animate",function(a, -c){var d=v("ngRepeat");return{transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,link:function(e,g,f,h,m){var k=f.ngRepeat,l=k.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),n,p,r,s,z,B,w={$id:Ja};if(!l)throw d("iexp",k);f=l[1];h=l[2];(l=l[3])?(n=a(l),p=function(a,c,d){B&&(w[B]=a);w[z]=c;w.$index=d;return n(e,w)}):(r=function(a,c){return Ja(c)},s=function(a){return a});l=f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!l)throw d("iidexp",f);z=l[3]||l[1]; -B=l[2];var H={};e.$watchCollection(h,function(a){var f,h,l=g[0],n,w={},E,R,t,C,S,v,D=[];if(db(a))S=a,n=p||r;else{n=p||s;S=[];for(t in a)a.hasOwnProperty(t)&&"$"!=t.charAt(0)&&S.push(t);S.sort()}E=S.length;h=D.length=S.length;for(f=0;fA;)u.pop().element.remove()}for(;x.length>J;)x.pop()[0].element.remove()}var k;if(!(k= -t.match(d)))throw cf("iexp",t,ha(f));var m=c(k[2]||k[1]),l=k[4]||k[6],n=k[5],p=c(k[3]||""),q=c(k[2]?k[1]:l),y=c(k[7]),v=k[8]?c(k[8]):null,x=[[{element:f,label:""}]];z&&(a(z)(e),z.removeClass("ng-scope"),z.remove());f.empty();f.on("change",function(){e.$apply(function(){var a,c=y(e)||[],d={},h,k,m,p,t,w,u;if(r)for(k=[],p=0,w=x.length;p@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}'); -//# sourceMappingURL=angular.min.js.map diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/lib/jwt-decode.min.js b/examples/authz/photoz/photoz-html5-client/src/main/webapp/lib/jwt-decode.min.js deleted file mode 100644 index f56f96737a..0000000000 --- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/lib/jwt-decode.min.js +++ /dev/null @@ -1 +0,0 @@ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g>8-f%1*8)){if(e=a.charCodeAt(f+=.75),e>255)throw d;c=c<<8|e}return h}),a.atob||(a.atob=function(a){if(a=a.replace(/=+$/,""),a.length%4==1)throw d;for(var c,e,f=0,g=0,h="";e=a.charAt(g++);~e&&(c=f%4?64*c+e:e,f++%4)?h+=String.fromCharCode(255&c>>(-2*f&6)):0)e=b.indexOf(e);return h})}()},{}],5:[function(a){var b="undefined"!=typeof self?self:"undefined"!=typeof window?window:{},c=a("./lib/index");"function"==typeof b.window.define&&b.window.define.amd?b.window.define("jwt_decode",function(){return c}):b.window&&(b.window.jwt_decode=c)},{"./lib/index":2}]},{},[5]); \ No newline at end of file diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/admin/albums.html b/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/admin/albums.html deleted file mode 100644 index 0f4da1461a..0000000000 --- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/admin/albums.html +++ /dev/null @@ -1,22 +0,0 @@ -

All Albums

- - - - - - - - - - - -
{{key}}
- -
-

-Back to main page -

\ No newline at end of file diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/create.html b/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/create.html deleted file mode 100644 index 0433f49d4b..0000000000 --- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/create.html +++ /dev/null @@ -1,7 +0,0 @@ -

Create an Album

- -
- Name: - - -
diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/detail.html b/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/detail.html deleted file mode 100644 index 096e08cf5c..0000000000 --- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/album/detail.html +++ /dev/null @@ -1,4 +0,0 @@ -

{{album.name}}

- - - \ No newline at end of file diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/home.html b/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/home.html deleted file mode 100644 index fffcdeab9f..0000000000 --- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/home.html +++ /dev/null @@ -1,22 +0,0 @@ -

Welcome To Photoz, {{Identity.claims.name}}

-
Administration: [All Albums]
-
-
-
-Create Album | My Profile -
-

Your Albums

-You don't have any albums, yet. - - - - -
{{p.name}} - [X]
-

Shared With Me

-You don't have any shares, yet. - - - - -
{{p.album.name}} - [X]Request Delete Access
-
\ No newline at end of file diff --git a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/profile.html b/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/profile.html deleted file mode 100644 index 4cf5d142f8..0000000000 --- a/examples/authz/photoz/photoz-html5-client/src/main/webapp/partials/profile.html +++ /dev/null @@ -1,9 +0,0 @@ -

My Profile

- -
-

Name: {{profile.userName}}

-

Total of albums: {{profile.totalAlbums}}

-
-

- Back to main page -

diff --git a/examples/authz/photoz/photoz-realm.json b/examples/authz/photoz/photoz-realm.json deleted file mode 100644 index 4a15c389a6..0000000000 --- a/examples/authz/photoz/photoz-realm.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "realm": "photoz", - "enabled": true, - "userManagedAccessAllowed": "true", - "sslRequired": "external", - "privateKey": "MIICXAIBAAKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQABAoGAfmO8gVhyBxdqlxmIuglbz8bcjQbhXJLR2EoS8ngTXmN1bo2L90M0mUKSdc7qF10LgETBzqL8jYlQIbt+e6TH8fcEpKCjUlyq0Mf/vVbfZSNaVycY13nTzo27iPyWQHK5NLuJzn1xvxxrUeXI6A2WFpGEBLbHjwpx5WQG9A+2scECQQDvdn9NE75HPTVPxBqsEd2z10TKkl9CZxu10Qby3iQQmWLEJ9LNmy3acvKrE3gMiYNWb6xHPKiIqOR1as7L24aTAkEAtyvQOlCvr5kAjVqrEKXalj0Tzewjweuxc0pskvArTI2Oo070h65GpoIKLc9jf+UA69cRtquwP93aZKtW06U8dQJAF2Y44ks/mK5+eyDqik3koCI08qaC8HYq2wVl7G2QkJ6sbAaILtcvD92ToOvyGyeE0flvmDZxMYlvaZnaQ0lcSQJBAKZU6umJi3/xeEbkJqMfeLclD27XGEFoPeNrmdx0q10Azp4NfJAY+Z8KRyQCR2BEG+oNitBOZ+YXF9KCpH3cdmECQHEigJhYg+ykOvr1aiZUMFT72HU0jnmQe2FVekuG+LJUt2Tm7GtMjTFoGpf0JwrVuZN39fOYAlo+nTixgeW7X8Y=", - "publicKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", - "requiredCredentials": [ - "password" - ], - "users": [ - { - "username": "alice", - "enabled": true, - "email": "alice@keycloak.org", - "firstName": "Alice", - "lastName": "In Chains", - "credentials": [ - { - "type": "password", - "value": "alice" - } - ], - "realmRoles": [ - "user", "uma_authorization" - ], - "clientRoles": { - "photoz-restful-api": [ - "manage-albums" - ], - "account": [ - "manage-account" - ] - } - }, - { - "username": "jdoe", - "enabled": true, - "email": "jdoe@keycloak.org", - "firstName": "John", - "lastName": "Doe", - "credentials": [ - { - "type": "password", - "value": "jdoe" - } - ], - "realmRoles": [ - "user", "uma_authorization" - ], - "clientRoles": { - "photoz-restful-api": [ - "manage-albums" - ], - "account": [ - "manage-account" - ] - } - }, - { - "username": "admin", - "enabled": true, - "email": "admin@admin.com", - "firstName": "Admin", - "lastName": "Istrator", - "credentials": [ - { - "type": "password", - "value": "admin" - } - ], - "realmRoles": [ - "admin", "uma_authorization" - ], - "clientRoles": { - "realm-management": [ - "realm-admin" - ], - "photoz-restful-api": [ - "manage-albums" - ] - } - }, - { - "username": "service-account-photoz-restful-api", - "enabled": true, - "email": "service-account-photoz-restful-api@placeholder.org", - "serviceAccountClientId": "photoz-restful-api", - "clientRoles": { - "photoz-restful-api" : ["uma_protection"] - } - } - ], - "roles": { - "realm": [ - { - "name": "user", - "description": "User privileges" - }, - { - "name": "admin", - "description": "Administrator privileges" - } - ] - }, - "clients": [ - { - "clientId": "photoz-html5-client", - "enabled": true, - "adminUrl": "http://localhost:8080/photoz-html5-client", - "baseUrl": "http://localhost:8080/photoz-html5-client", - "publicClient": true, - "consentRequired" : true, - "fullScopeAllowed" : true, - "redirectUris": [ - "http://localhost:8080/photoz-html5-client/*" - ], - "webOrigins": ["http://localhost:8080"] - }, - { - "clientId": "photoz-restful-api", - "secret": "secret", - "enabled": true, - "baseUrl": "http://localhost:8080/photoz-restful-api", - "authorizationServicesEnabled" : true, - "redirectUris": [ - "http://localhost:8080/photoz-html5-client" - ], - "webOrigins" : ["http://localhost:8080"] - } - ] -} diff --git a/examples/authz/photoz/photoz-restful-api/pom.xml b/examples/authz/photoz/photoz-restful-api/pom.xml deleted file mode 100755 index 99c7a10c92..0000000000 --- a/examples/authz/photoz/photoz-restful-api/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - 4.0.0 - - - org.keycloak - keycloak-authz-photoz-parent - 4.0.0.CR1-SNAPSHOT - ../pom.xml - - - photoz-restful-api - war - - Keycloak Authz: Photoz RESTful API - Photoz RESTful API - - - - org.jboss.spec.javax.ws.rs - jboss-jaxrs-api_2.0_spec - provided - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - provided - - - javax.persistence - persistence-api - 1.0.2 - provided - - - org.jboss.spec.javax.ejb - jboss-ejb-api_3.2_spec - 1.0.0.Final - provided - - - javax.enterprise - cdi-api - 1.0-SP4 - provided - - - org.keycloak - keycloak-authz-client - ${project.version} - provided - - - - - ${project.artifactId} - - - src/main/resources - true - - - - - org.jboss.as.plugins - jboss-as-maven-plugin - - false - - - - org.wildfly.plugins - wildfly-maven-plugin - - false - - - - - diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/ErrorResponse.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/ErrorResponse.java deleted file mode 100644 index 51755d899e..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/ErrorResponse.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.keycloak.example.photoz; - -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Response; -import java.util.HashMap; -import java.util.Map; - -/** - * @author Pedro Igor - */ -public class ErrorResponse extends WebApplicationException { - - private final Response.Status status; - - public ErrorResponse(String message) { - this(message, Response.Status.INTERNAL_SERVER_ERROR); - } - - public ErrorResponse(String message, Response.Status status) { - super(message, status); - this.status = status; - } - - @Override - public Response getResponse() { - Map errorResponse = new HashMap<>(); - - errorResponse.put("message", getMessage()); - - return Response.status(status).entity(errorResponse).build(); - } -} diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/PhotozApplication.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/PhotozApplication.java deleted file mode 100644 index 5b8377ced6..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/PhotozApplication.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.keycloak.example.photoz; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -/** - * Basic auth app. - */ -@ApplicationPath("/") -public class PhotozApplication extends Application { - -} diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/admin/AdminAlbumService.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/admin/AdminAlbumService.java deleted file mode 100644 index 684f2161d7..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/admin/AdminAlbumService.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * 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 org.keycloak.example.photoz.admin; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import javax.inject.Inject; -import javax.persistence.EntityManager; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Response; - -import org.keycloak.example.photoz.entity.Album; - -/** - * @author Pedro Igor - */ -@Path("/admin/album") -public class AdminAlbumService { - - @Inject - private EntityManager entityManager; - - @GET - @Produces("application/json") - public Response findAll() { - HashMap> albums = new HashMap<>(); - List result = this.entityManager.createQuery("from Album").getResultList(); - - for (Album album : result) { - List userAlbums = albums.get(album.getUserId()); - - if (userAlbums == null) { - userAlbums = new ArrayList<>(); - albums.put(album.getUserId(), userAlbums); - } - - userAlbums.add(album); - } - - return Response.ok(albums).build(); - } -} diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/AlbumService.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/AlbumService.java deleted file mode 100644 index b49ba90123..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/AlbumService.java +++ /dev/null @@ -1,181 +0,0 @@ -package org.keycloak.example.photoz.album; - -import java.security.Principal; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import javax.inject.Inject; -import javax.persistence.EntityManager; -import javax.persistence.Query; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; - -import org.keycloak.KeycloakSecurityContext; -import org.keycloak.authorization.client.AuthzClient; -import org.keycloak.authorization.client.ClientAuthorizationContext; -import org.keycloak.authorization.client.representation.ResourceRepresentation; -import org.keycloak.authorization.client.representation.ScopeRepresentation; -import org.keycloak.authorization.client.resource.ProtectionResource; -import org.keycloak.example.photoz.ErrorResponse; -import org.keycloak.example.photoz.entity.Album; -import org.keycloak.example.photoz.util.Transaction; -import org.keycloak.representations.idm.authorization.PermissionTicketRepresentation; - -@Path("/album") -@Transaction -public class AlbumService { - - public static final String SCOPE_ALBUM_VIEW = "album:view"; - public static final String SCOPE_ALBUM_DELETE = "album:delete"; - - @Inject - private EntityManager entityManager; - - @Context - private HttpServletRequest request; - - @POST - @Consumes("application/json") - public Response create(Album newAlbum) { - Principal userPrincipal = request.getUserPrincipal(); - - newAlbum.setId(UUID.randomUUID().toString()); - newAlbum.setUserId(userPrincipal.getName()); - - Query queryDuplicatedAlbum = this.entityManager.createQuery("from Album where name = :name and userId = :userId"); - - queryDuplicatedAlbum.setParameter("name", newAlbum.getName()); - queryDuplicatedAlbum.setParameter("userId", userPrincipal.getName()); - - if (!queryDuplicatedAlbum.getResultList().isEmpty()) { - throw new ErrorResponse("Name [" + newAlbum.getName() + "] already taken. Choose another one.", Status.CONFLICT); - } - - try { - this.entityManager.persist(newAlbum); - createProtectedResource(newAlbum); - } catch (Exception e) { - getAuthzClient().protection().resource().delete(newAlbum.getExternalId()); - } - - return Response.ok(newAlbum).build(); - } - - @Path("{id}") - @DELETE - public Response delete(@PathParam("id") String id) { - Album album = this.entityManager.find(Album.class, id); - - try { - deleteProtectedResource(album); - this.entityManager.remove(album); - } catch (Exception e) { - throw new RuntimeException("Could not delete album.", e); - } - - return Response.ok().build(); - } - - @GET - @Produces("application/json") - public Response findAll() { - return Response.ok(this.entityManager.createQuery("from Album where userId = :id").setParameter("id", request.getUserPrincipal().getName()).getResultList()).build(); - } - - @GET - @Path("/shares") - @Produces("application/json") - public Response findShares() { - List permissions = getAuthzClient().protection().permission().find(null, null, null, getKeycloakSecurityContext().getToken().getSubject(), true, true, null, null); - Map shares = new HashMap<>(); - - for (PermissionTicketRepresentation permission : permissions) { - SharedAlbum share = shares.get(permission.getResource()); - - if (share == null) { - share = new SharedAlbum(Album.class.cast(entityManager.createQuery("from Album where externalId = :externalId").setParameter("externalId", permission.getResource()).getSingleResult())); - shares.put(permission.getResource(), share); - } - - if (permission.getScope() != null) { - share.addScope(permission.getScopeName()); - } - } - - return Response.ok(shares.values()).build(); - } - - @GET - @Path("{id}") - @Produces("application/json") - public Response findById(@PathParam("id") String id) { - List result = this.entityManager.createQuery("from Album where id = :id").setParameter("id", id).getResultList(); - - if (result.isEmpty()) { - return Response.status(Status.NOT_FOUND).build(); - } - - return Response.ok(result.get(0)).build(); - } - - private void createProtectedResource(Album album) { - try { - HashSet scopes = new HashSet<>(); - - scopes.add(new ScopeRepresentation(SCOPE_ALBUM_VIEW)); - scopes.add(new ScopeRepresentation(SCOPE_ALBUM_DELETE)); - - ResourceRepresentation albumResource = new ResourceRepresentation(album.getName(), scopes, "/album/" + album.getId(), "http://photoz.com/album"); - - albumResource.setOwner(album.getUserId()); - albumResource.setOwnerManagedAccess(true); - - ResourceRepresentation response = getAuthzClient().protection().resource().create(albumResource); - - album.setExternalId(response.getId()); - } catch (Exception e) { - throw new RuntimeException("Could not register protected resource.", e); - } - } - - private void deleteProtectedResource(Album album) { - String uri = "/album/" + album.getId(); - - try { - ProtectionResource protection = getAuthzClient().protection(); - List search = protection.resource().findByUri(uri); - - if (search.isEmpty()) { - throw new RuntimeException("Could not find protected resource with URI [" + uri + "]"); - } - - protection.resource().delete(search.get(0).getId()); - } catch (Exception e) { - throw new RuntimeException("Could not search protected resource.", e); - } - } - - private AuthzClient getAuthzClient() { - return getAuthorizationContext().getClient(); - } - - private ClientAuthorizationContext getAuthorizationContext() { - return ClientAuthorizationContext.class.cast(getKeycloakSecurityContext().getAuthorizationContext()); - } - - private KeycloakSecurityContext getKeycloakSecurityContext() { - return KeycloakSecurityContext.class.cast(request.getAttribute(KeycloakSecurityContext.class.getName())); - } -} diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/ProfileService.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/ProfileService.java deleted file mode 100644 index 62591227d7..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/ProfileService.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * 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 org.keycloak.example.photoz.album; - -import javax.inject.Inject; -import javax.persistence.EntityManager; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import java.security.Principal; -import java.util.List; - -/** - * @author Pedro Igor - */ -@Path("/profile") -public class ProfileService { - - private static final String PROFILE_VIEW = "urn:photoz.com:scopes:profile:view"; - - @Inject - private EntityManager entityManager; - - @GET - @Produces("application/json") - public Response view(@Context HttpServletRequest request) { - Principal userPrincipal = request.getUserPrincipal(); - List albums = this.entityManager.createQuery("from Album where userId = :id").setParameter("id", userPrincipal.getName()).getResultList(); - return Response.ok(new Profile(userPrincipal.getName(), albums.size())).build(); - } - - public static class Profile { - private String userName; - private int totalAlbums; - - public Profile(String name, int totalAlbums) { - this.userName = name; - this.totalAlbums = totalAlbums; - } - - public String getUserName() { - return userName; - } - - public int getTotalAlbums() { - return totalAlbums; - } - } -} diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/SharedAlbum.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/SharedAlbum.java deleted file mode 100644 index dfc5fb1281..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/album/SharedAlbum.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * 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 org.keycloak.example.photoz.album; - -import java.util.ArrayList; -import java.util.List; - -import org.keycloak.example.photoz.entity.Album; - -public class SharedAlbum { - - private Album album; - private List scopes; - - public SharedAlbum(Album album) { - this.album = album; - } - - public Album getAlbum() { - return album; - } - - public List getScopes() { - return scopes; - } - - public void addScope(String scope) { - if (scopes == null) { - scopes = new ArrayList<>(); - } - scopes.add(scope); - } -} diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/entity/Album.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/entity/Album.java deleted file mode 100644 index d8dda5fe21..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/entity/Album.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * 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 org.keycloak.example.photoz.entity; - -import java.util.ArrayList; -import java.util.List; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.OneToMany; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Pedro Igor - */ -@Entity -public class Album { - - @Id - private String id; - - @Column(nullable = false) - private String name; - - @OneToMany(mappedBy = "album", fetch = FetchType.EAGER) - private List photos = new ArrayList<>(); - - @Column(nullable = false) - private String userId; - - @Column - private String externalId; - - public String getId() { - return this.id; - } - - public void setId(final String id) { - this.id = id; - } - - public String getName() { - return this.name; - } - - public void setName(final String name) { - this.name = name; - } - - public List getPhotos() { - return this.photos; - } - - public void setPhotos(final List photos) { - this.photos = photos; - } - - public void setUserId(final String userId) { - this.userId = userId; - } - - public String getUserId() { - return this.userId; - } - - public void setExternalId(String externalId) { - this.externalId = externalId; - } - - public String getExternalId() { - return externalId; - } -} diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/entity/Photo.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/entity/Photo.java deleted file mode 100644 index 08b7495f73..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/entity/Photo.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * 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 org.keycloak.example.photoz.entity; - -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.Lob; -import javax.persistence.ManyToOne; - -/** - * @author Pedro Igor - */ -@Entity -public class Photo { - - @Id - @GeneratedValue - private Long id; - - @Column - private String name; - - @ManyToOne - private Album album; - - @Lob - @Column - @Basic(fetch = FetchType.LAZY) - private byte[] image; - - public Long getId() { - return this.id; - } - - public void setId(final Long id) { - this.id = id; - } - - public String getName() { - return this.name; - } - - public void setName(final String name) { - this.name = name; - } - - public Album getAlbum() { - return this.album; - } - - public void setAlbum(final Album album) { - this.album = album; - } - - public byte[] getImage() { - return this.image; - } - - public void setImage(final byte[] image) { - this.image = image; - } -} diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Resources.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Resources.java deleted file mode 100644 index c917da24db..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Resources.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * 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 org.keycloak.example.photoz.util; - -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.context.RequestScoped; -import javax.enterprise.inject.Produces; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.Persistence; - -/** - * @author Pedro Igor - */ -@ApplicationScoped -public class Resources { - - private EntityManagerFactory entityManagerFactory; - - @PostConstruct - public void init() { - entityManagerFactory = Persistence.createEntityManagerFactory("primary"); - } - - @PreDestroy - public void dispose() { - entityManagerFactory.close(); - } - - @RequestScoped - @Produces - public EntityManager createEntityManager() { - return entityManagerFactory.createEntityManager(); - } -} diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Transaction.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Transaction.java deleted file mode 100644 index 6f5d5ec229..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/Transaction.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * 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 org.keycloak.example.photoz.util; - -import javax.interceptor.InterceptorBinding; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * @author Pedro Igor - */ -@InterceptorBinding -@Target({ TYPE }) -@Retention(RUNTIME) -public @interface Transaction { -} diff --git a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/TransactionInterceptor.java b/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/TransactionInterceptor.java deleted file mode 100644 index 36d35f319b..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/java/org/keycloak/example/photoz/util/TransactionInterceptor.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * 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 org.keycloak.example.photoz.util; - -import javax.enterprise.inject.Instance; -import javax.inject.Inject; -import javax.interceptor.AroundInvoke; -import javax.interceptor.Interceptor; -import javax.interceptor.InvocationContext; -import javax.persistence.EntityManager; -import javax.persistence.EntityTransaction; - -/** - * @author Pedro Igor - */ -@Interceptor -@Transaction -public class TransactionInterceptor { - - @Inject - private Instance entityManager; - - @AroundInvoke - public Object aroundInvoke(InvocationContext context) { - EntityManager entityManager = this.entityManager.get(); - EntityTransaction transaction = entityManager.getTransaction(); - - try { - transaction.begin(); - Object proceed = context.proceed(); - transaction.commit(); - return proceed; - } catch (Exception cause) { - if (transaction != null && transaction.isActive()) { - transaction.rollback(); - } - throw new RuntimeException(cause); - } finally { - entityManager.close(); - } - } -} diff --git a/examples/authz/photoz/photoz-restful-api/src/main/resources/META-INF/beans.xml b/examples/authz/photoz/photoz-restful-api/src/main/resources/META-INF/beans.xml deleted file mode 100644 index fbf2a32edf..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/resources/META-INF/beans.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - org.keycloak.example.photoz.util.TransactionInterceptor - - diff --git a/examples/authz/photoz/photoz-restful-api/src/main/resources/META-INF/persistence.xml b/examples/authz/photoz/photoz-restful-api/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index c15d34f449..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - org.hibernate.ejb.HibernatePersistence - - org.keycloak.example.photoz.entity.Album - org.keycloak.example.photoz.entity.Photo - - - - - - - - - - - - diff --git a/examples/authz/photoz/photoz-restful-api/src/main/resources/photoz-restful-api-authz-service.json b/examples/authz/photoz/photoz-restful-api/src/main/resources/photoz-restful-api-authz-service.json deleted file mode 100644 index d94ce40f59..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/resources/photoz-restful-api-authz-service.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "allowRemoteResourceManagement": true, - "policyEnforcementMode": "ENFORCING", - "resources": [ - { - "name": "Admin Resources", - "uri": "/admin/*", - "type": "http://photoz.com/admin", - "scopes": [ - { - "name": "admin:manage" - } - ] - }, - { - "name": "User Profile Resource", - "uri": "/profile", - "type": "http://photoz.com/profile", - "scopes": [ - { - "name": "profile:view" - } - ] - }, - { - "name": "Album Resource", - "uri": "/album/*", - "type": "http://photoz.com/album", - "scopes": [ - { - "name": "album:delete" - }, - { - "name": "album:view" - } - ] - } - ], - "policies": [ - { - "name": "Only Owner and Administrators Policy", - "description": "Defines that only the resource owner and administrators can do something", - "type": "aggregate", - "logic": "POSITIVE", - "decisionStrategy": "AFFIRMATIVE", - "config": { - "applyPolicies": "[\"Administration Policy\",\"Only Owner Policy\"]" - } - }, - { - "name": "Administration Policy", - "description": "Defines that only administrators from a specific network address can do something.", - "type": "aggregate", - "logic": "POSITIVE", - "decisionStrategy": "UNANIMOUS", - "config": { - "applyPolicies": "[\"Any Admin Policy\",\"Only From a Specific Client Address\"]" - } - }, - { - "name": "Only From @keycloak.org or Admin", - "description": "Defines that only users from @keycloak.org", - "type": "js", - "logic": "POSITIVE", - "decisionStrategy": "UNANIMOUS", - "config": { - "code": "var context = $evaluation.getContext();\nvar identity = context.getIdentity();\nvar attributes = identity.getAttributes();\nvar email = attributes.getValue('email').asString(0);\n\nif (identity.hasRealmRole('admin') || email.endsWith('@keycloak.org')) {\n $evaluation.grant();\n}" - } - }, - { - "name": "Only Owner Policy", - "description": "Defines that only the resource owner is allowed to do something", - "type": "rules", - "logic": "POSITIVE", - "decisionStrategy": "UNANIMOUS", - "config": { - "mavenArtifactVersion": "${project.version}", - "mavenArtifactId": "photoz-authz-policy", - "sessionName": "MainOwnerSession", - "mavenArtifactGroupId": "org.keycloak", - "moduleName": "PhotozAuthzOwnerPolicy", - "scannerPeriod": "1", - "scannerPeriodUnit": "Hours" - } - }, - { - "name": "Any Admin Policy", - "description": "Defines that adminsitrators can do something", - "type": "role", - "logic": "POSITIVE", - "decisionStrategy": "UNANIMOUS", - "config": { - "roles": "[{\"id\":\"admin\",\"required\":true}]" - } - }, - { - "name": "Only From a Specific Client Address", - "description": "Defines that only clients from a specific address can do something", - "type": "js", - "logic": "POSITIVE", - "decisionStrategy": "UNANIMOUS", - "config": { - "code": "var contextAttributes = $evaluation.getContext().getAttributes();\n\nif (contextAttributes.containsValue('kc.client.network.ip_address', '127.0.0.1')) {\n $evaluation.grant();\n}" - } - }, - { - "name": "Any User Policy", - "description": "Defines that only users from well known clients are allowed to access", - "type": "role", - "logic": "POSITIVE", - "decisionStrategy": "UNANIMOUS", - "config": { - "roles": "[{\"id\":\"user\",\"required\":false},{\"id\":\"photoz-restful-api/manage-albums\",\"required\":true}]" - } - }, - { - "name": "Admin Resource Permission", - "description": "General policy for any administrative resource.", - "type": "resource", - "logic": "POSITIVE", - "decisionStrategy": "UNANIMOUS", - "config": { - "defaultResourceType": "http://photoz.com/admin", - "applyPolicies": "[\"Administration Policy\"]", - "default": "true" - } - }, - { - "name": "Album Resource Permission", - "description": "A default permission that defines access for any album resource", - "type": "scope", - "logic": "POSITIVE", - "decisionStrategy": "UNANIMOUS", - "config": { - "resources": "[\"Album Resource\"]", - "scopes": "[\"album:view\",\"album:delete\"]", - "applyPolicies": "[\"Only Owner and Administrators Policy\"]" - } - }, - { - "name": "View User Permission", - "description": "Defines who is allowed to view an user profile", - "type": "scope", - "logic": "POSITIVE", - "decisionStrategy": "UNANIMOUS", - "config": { - "scopes": "[\"profile:view\"]", - "applyPolicies": "[\"Only From @keycloak.org or Admin\"]" - } - } - ] -} \ No newline at end of file diff --git a/examples/authz/photoz/photoz-restful-api/src/main/webapp/META-INF/jboss-deployment-structure.xml b/examples/authz/photoz/photoz-restful-api/src/main/webapp/META-INF/jboss-deployment-structure.xml deleted file mode 100644 index 455335898f..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/webapp/META-INF/jboss-deployment-structure.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - diff --git a/examples/authz/photoz/photoz-restful-api/src/main/webapp/WEB-INF/keycloak.json b/examples/authz/photoz/photoz-restful-api/src/main/webapp/WEB-INF/keycloak.json deleted file mode 100644 index 774845052b..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/webapp/WEB-INF/keycloak.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "realm": "photoz", - "auth-server-url": "http://localhost:8180/auth", - "ssl-required": "external", - "resource": "photoz-restful-api", - "bearer-only" : true, - "credentials": { - "secret": "secret" - }, - "policy-enforcer": { - "enforcement-mode": "PERMISSIVE", - "user-managed-access": {}, - "paths": [ - { - "name" : "Album Resource", - "path" : "/album/{id}", - "methods" : [ - { - "method": "DELETE", - "scopes" : ["album:delete"] - }, - { - "method": "GET", - "scopes" : ["album:view"] - } - ] - }, - { - "name" : "Album Resource", - "path" : "/album/shares", - "enforcement-mode": "DISABLED" - }, - { - "path" : "/profile" - }, - { - "name" : "Admin Resources", - "path" : "/admin/*" - } - ] - } -} \ No newline at end of file diff --git a/examples/authz/photoz/photoz-restful-api/src/main/webapp/WEB-INF/web.xml b/examples/authz/photoz/photoz-restful-api/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 34cf6bd6a1..0000000000 --- a/examples/authz/photoz/photoz-restful-api/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - photoz-restful-api - - - - All Resources - /* - - - user - - - - - - All Resources - /* - - - admin - - - - - KEYCLOAK - photoz - - - - admin - - - - user - - diff --git a/examples/authz/photoz/pom.xml b/examples/authz/photoz/pom.xml deleted file mode 100755 index 3e711e5a9b..0000000000 --- a/examples/authz/photoz/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - 4.0.0 - - - org.keycloak - keycloak-authz-example-parent - 4.0.0.CR1-SNAPSHOT - ../pom.xml - - - keycloak-authz-photoz-parent - pom - - Keycloak Authz: PhotoZ Example Application Parent - PhotoZ Example Application - - - photoz-restful-api - photoz-html5-client - photoz-authz-policy - - diff --git a/examples/authz/pom.xml b/examples/authz/pom.xml deleted file mode 100755 index a32c665187..0000000000 --- a/examples/authz/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - - keycloak-examples-parent - org.keycloak - 4.0.0.CR1-SNAPSHOT - ../pom.xml - - - keycloak-authz-example-parent - pom - - Keycloak Authz: Examples Parent - - - - 1.7 - 1.7 - - - - photoz - servlet-authz - hello-world - hello-world-authz-service - - diff --git a/examples/authz/servlet-authz/README.md b/examples/authz/servlet-authz/README.md deleted file mode 100644 index f93acb52ca..0000000000 --- a/examples/authz/servlet-authz/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# About the Example Application - -This is a simple Servlet-based application that will introduce you to some of the main concepts around Keycloak Authorization Services. - -For this application, users can be regular users, premium users or administrators, where: - -* Regular users have very limited access. -* Premium users have access to the *premium area* -* Administrators have access to the *administration area* - -In Keycloak, all the paths being protected are resources on the server. - -This application will also show you how to create a dynamic menu with the permissions granted to an user. - -## Create the Example Realm and a Resource Server - -Considering that your Keycloak Server is up and running, log in to the Keycloak Administration Console. - -Now, create a new realm based on the following configuration file: - - examples/authz/servlet-authz/servlet-authz-realm.json - -That will import a pre-configured realm with everything you need to run this example. For more details about how to import a realm -into Keycloak, check the Keycloak's reference documentation. - -After importing that file, you'll have a new realm called ``servlet-authz``. - -Now, let's import another configuration using the Administration Console in order to configure the client application ``servlet-authz-app`` as a resource server with all resources, scopes, permissions and policies. - -Click on ``Clients`` on the left side menu. Click on the ``servlet-authz-app`` on the client listing page. This will -open the ``Client Details`` page. Once there, click on the `Authorization` tab. - -Click on the ``Select file`` button, which means you want to import a resource server configuration. Now select the file that is located at: - - examples/authz/servlet-authz/servlet-authz-app-config.json - -Now click ``Upload`` and the resource server will be updated accordingly. - -## Deploy and Run the Example Applications - -To deploy the example application, follow these steps: - - cd examples/authz/servlet-authz - mvn clean package wildfly:deploy - -Now, try to access the client application using the following URL: - - http://localhost:8080/servlet-authz-app - -If everything is correct, you will be redirect to Keycloak login page. You can login to the application with the following credentials: - -* username: jdoe / password: jdoe -* username: alice / password: alice -* username: admin / password: admin \ No newline at end of file diff --git a/examples/authz/servlet-authz/pom.xml b/examples/authz/servlet-authz/pom.xml deleted file mode 100755 index e0c57002a3..0000000000 --- a/examples/authz/servlet-authz/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - 4.0.0 - - - org.keycloak - keycloak-authz-example-parent - 4.0.0.CR1-SNAPSHOT - ../pom.xml - - - servlet-authz - war - - Keycloak Authz: Examples - Servlet Authorization - Servlet Authorization - - - - - org.keycloak - keycloak-authz-client - ${project.version} - provided - - - org.keycloak - keycloak-core - ${project.version} - provided - - - - - ${project.artifactId} - - - org.jboss.as.plugins - jboss-as-maven-plugin - - false - - - - org.wildfly.plugins - wildfly-maven-plugin - - false - - - - - diff --git a/examples/authz/servlet-authz/servlet-authz-app-config.json b/examples/authz/servlet-authz/servlet-authz-app-config.json deleted file mode 100644 index 5b64811d40..0000000000 --- a/examples/authz/servlet-authz/servlet-authz-app-config.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "allowRemoteResourceManagement": true, - "policyEnforcementMode": "ENFORCING", - "resources": [ - { - "name": "Admin Resource", - "uri": "/protected/admin/*", - "type": "http://servlet-authz/protected/admin", - "scopes": [ - { - "name": "urn:servlet-authz:protected:admin:access" - } - ] - }, - { - "name": "Protected Resource", - "uri": "/*", - "type": "http://servlet-authz/protected/resource", - "scopes": [ - { - "name": "urn:servlet-authz:protected:resource:access" - } - ] - }, - { - "name": "Premium Resource", - "uri": "/protected/premium/*", - "scopes": [ - { - "name": "urn:servlet-authz:protected:premium:access" - } - ] - }, - { - "name": "Main Page", - "scopes": [ - { - "name": "urn:servlet-authz:page:main:actionForAdmin" - }, - { - "name": "urn:servlet-authz:page:main:actionForUser" - }, - { - "name": "urn:servlet-authz:page:main:actionForPremiumUser" - } - ] - } - ], - "policies": [ - { - "name": "Any Admin Policy", - "description": "Defines that adminsitrators can do something", - "type": "role", - "config": { - "roles": "[{\"id\":\"admin\"}]" - } - }, - { - "name": "Any User Policy", - "description": "Defines that any user can do something", - "type": "role", - "config": { - "roles": "[{\"id\":\"user\"}]" - } - }, - { - "name": "Only Premium User Policy", - "description": "Defines that only premium users can do something", - "type": "role", - "logic": "POSITIVE", - "config": { - "roles": "[{\"id\":\"user_premium\"}]" - } - }, - { - "name": "All Users Policy", - "description": "Defines that all users can do something", - "type": "aggregate", - "decisionStrategy": "AFFIRMATIVE", - "config": { - "applyPolicies": "[\"Any User Policy\",\"Any Admin Policy\",\"Only Premium User Policy\"]" - } - }, - { - "name": "Premium Resource Permission", - "description": "A policy that defines access to premium resources", - "type": "resource", - "decisionStrategy": "UNANIMOUS", - "config": { - "resources": "[\"Premium Resource\"]", - "applyPolicies": "[\"Only Premium User Policy\"]" - } - }, - { - "name": "Administrative Resource Permission", - "description": "A policy that defines access to administrative resources", - "type": "resource", - "decisionStrategy": "UNANIMOUS", - "config": { - "resources": "[\"Admin Resource\"]", - "applyPolicies": "[\"Any Admin Policy\"]" - } - }, - { - "name": "Protected Resource Permission", - "description": "A policy that defines access to any protected resource", - "type": "resource", - "decisionStrategy": "AFFIRMATIVE", - "config": { - "resources": "[\"Protected Resource\"]", - "applyPolicies": "[\"All Users Policy\"]" - } - }, - { - "name": "Action 1 on Main Page Resource Permission", - "description": "A policy that defines access to action 1 on the main page", - "type": "scope", - "decisionStrategy": "AFFIRMATIVE", - "config": { - "scopes": "[\"urn:servlet-authz:page:main:actionForAdmin\"]", - "applyPolicies": "[\"Any Admin Policy\"]" - } - }, - { - "name": "Action 2 on Main Page Resource Permission", - "description": "A policy that defines access to action 2 on the main page", - "type": "scope", - "decisionStrategy": "AFFIRMATIVE", - "config": { - "scopes": "[\"urn:servlet-authz:page:main:actionForUser\"]", - "applyPolicies": "[\"Any User Policy\"]" - } - }, - { - "name": "Action 3 on Main Page Resource Permission", - "description": "A policy that defines access to action 3 on the main page", - "type": "scope", - "decisionStrategy": "AFFIRMATIVE", - "config": { - "scopes": "[\"urn:servlet-authz:page:main:actionForPremiumUser\"]", - "applyPolicies": "[\"Only Premium User Policy\"]" - } - } - ] -} \ No newline at end of file diff --git a/examples/authz/servlet-authz/servlet-authz-realm.json b/examples/authz/servlet-authz/servlet-authz-realm.json deleted file mode 100644 index 371e4510f5..0000000000 --- a/examples/authz/servlet-authz/servlet-authz-realm.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "realm": "servlet-authz", - "enabled": true, - "privateKey": "MIICXAIBAAKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQABAoGAfmO8gVhyBxdqlxmIuglbz8bcjQbhXJLR2EoS8ngTXmN1bo2L90M0mUKSdc7qF10LgETBzqL8jYlQIbt+e6TH8fcEpKCjUlyq0Mf/vVbfZSNaVycY13nTzo27iPyWQHK5NLuJzn1xvxxrUeXI6A2WFpGEBLbHjwpx5WQG9A+2scECQQDvdn9NE75HPTVPxBqsEd2z10TKkl9CZxu10Qby3iQQmWLEJ9LNmy3acvKrE3gMiYNWb6xHPKiIqOR1as7L24aTAkEAtyvQOlCvr5kAjVqrEKXalj0Tzewjweuxc0pskvArTI2Oo070h65GpoIKLc9jf+UA69cRtquwP93aZKtW06U8dQJAF2Y44ks/mK5+eyDqik3koCI08qaC8HYq2wVl7G2QkJ6sbAaILtcvD92ToOvyGyeE0flvmDZxMYlvaZnaQ0lcSQJBAKZU6umJi3/xeEbkJqMfeLclD27XGEFoPeNrmdx0q10Azp4NfJAY+Z8KRyQCR2BEG+oNitBOZ+YXF9KCpH3cdmECQHEigJhYg+ykOvr1aiZUMFT72HU0jnmQe2FVekuG+LJUt2Tm7GtMjTFoGpf0JwrVuZN39fOYAlo+nTixgeW7X8Y=", - "publicKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", - "requiredCredentials": [ - "password" - ], - "users": [ - { - "username": "alice", - "enabled": true, - "credentials": [ - { - "type": "password", - "value": "alice" - } - ], - "realmRoles": [ - "user" - ] - }, - { - "username": "jdoe", - "enabled": true, - "credentials": [ - { - "type": "password", - "value": "jdoe" - } - ], - "realmRoles": [ - "user", - "user_premium" - ] - }, - { - "username": "admin", - "enabled": true, - "credentials": [ - { - "type": "password", - "value": "admin" - } - ], - "realmRoles": [ - "user", - "admin" - ], - "clientRoles": { - "realm-management": [ - "realm-admin" - ] - } - }, - { - "username": "service-account-servlet-authz-app", - "enabled": true, - "serviceAccountClientId": "servlet-authz-app", - "clientRoles": { - "servlet-authz-app" : ["uma_protection"] - } - } - ], - "roles": { - "realm": [ - { - "name": "user", - "description": "User privileges" - }, - { - "name": "admin", - "description": "Administrator privileges" - }, - { - "name": "user_premium", - "description": "User Premium privileges" - } - ] - }, - "clients": [ - { - "clientId": "servlet-authz-app", - "enabled": true, - "baseUrl": "/servlet-authz-app", - "adminUrl": "/servlet-authz-app", - "bearerOnly": false, - "authorizationServicesEnabled": true, - "redirectUris": [ - "/servlet-authz-app/*" - ], - "secret": "secret" - } - ] -} diff --git a/examples/authz/servlet-authz/src/main/webapp/META-INF/jboss-deployment-structure.xml b/examples/authz/servlet-authz/src/main/webapp/META-INF/jboss-deployment-structure.xml deleted file mode 100644 index 515ffa5c73..0000000000 --- a/examples/authz/servlet-authz/src/main/webapp/META-INF/jboss-deployment-structure.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/examples/authz/servlet-authz/src/main/webapp/WEB-INF/keycloak.json b/examples/authz/servlet-authz/src/main/webapp/WEB-INF/keycloak.json deleted file mode 100644 index d2834c3ce8..0000000000 --- a/examples/authz/servlet-authz/src/main/webapp/WEB-INF/keycloak.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "realm": "servlet-authz", - "auth-server-url": "http://localhost:8180/auth", - "ssl-required": "external", - "resource": "servlet-authz-app", - "credentials": { - "secret": "secret" - }, - "policy-enforcer": {} -} \ No newline at end of file diff --git a/examples/authz/servlet-authz/src/main/webapp/WEB-INF/web.xml b/examples/authz/servlet-authz/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index e4ce0f1fb0..0000000000 --- a/examples/authz/servlet-authz/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - servlet-authz-app - - - - All Resources - /* - - - user - admin - user_premium - - - - - KEYCLOAK - servlet-authz - - - - admin - - - - user - - - - user_premium - - - - 403 - /accessDenied.jsp - - - \ No newline at end of file diff --git a/examples/authz/servlet-authz/src/main/webapp/accessDenied.jsp b/examples/authz/servlet-authz/src/main/webapp/accessDenied.jsp deleted file mode 100644 index 6f25023af0..0000000000 --- a/examples/authz/servlet-authz/src/main/webapp/accessDenied.jsp +++ /dev/null @@ -1,6 +0,0 @@ - - -

You can not access this resource.

- <%@include file="logout-include.jsp"%> - - \ No newline at end of file diff --git a/examples/authz/servlet-authz/src/main/webapp/index.jsp b/examples/authz/servlet-authz/src/main/webapp/index.jsp deleted file mode 100755 index 345a69dffc..0000000000 --- a/examples/authz/servlet-authz/src/main/webapp/index.jsp +++ /dev/null @@ -1,35 +0,0 @@ -<%@page import="org.keycloak.AuthorizationContext" %> -<%@ page import="org.keycloak.KeycloakSecurityContext" %> -<%@ page import="org.keycloak.representations.idm.authorization.Permission" %> - -<% - KeycloakSecurityContext keycloakSecurityContext = (KeycloakSecurityContext) request.getAttribute(KeycloakSecurityContext.class.getName()); - AuthorizationContext authzContext = keycloakSecurityContext.getAuthorizationContext(); -%> - - - - <%@include file="logout-include.jsp"%> -

This is a public resource. Try to access one of these protected resources:

- -

Dynamic Menu

-

User Premium

-

Administration

- -

Your permissions are:

- -
    - <% - for (Permission permission : authzContext.getPermissions()) { - %> -
  • -

    Resource: <%= permission.getResourceName() %>

    -

    ID: <%= permission.getResourceId() %>

    -

    Scopes: <%= permission.getScopes() %>

    -
  • - <% - } - %> -
- - diff --git a/examples/authz/servlet-authz/src/main/webapp/logout-include.jsp b/examples/authz/servlet-authz/src/main/webapp/logout-include.jsp deleted file mode 100644 index 21ef2edebf..0000000000 --- a/examples/authz/servlet-authz/src/main/webapp/logout-include.jsp +++ /dev/null @@ -1,11 +0,0 @@ -<%@ page import="org.keycloak.common.util.KeycloakUriBuilder" %> -<%@ page import="org.keycloak.constants.ServiceUrlConstants" %> -<% - String scheme = request.getScheme(); - String host = request.getServerName(); - int port = request.getServerPort(); - String contextPath = request.getContextPath(); - String redirectUri = scheme + "://" + host + ":" + port + contextPath; -%> -

Click here ">Sign Out

\ No newline at end of file diff --git a/examples/authz/servlet-authz/src/main/webapp/protected/admin/onlyAdmin.jsp b/examples/authz/servlet-authz/src/main/webapp/protected/admin/onlyAdmin.jsp deleted file mode 100644 index 5946cd660c..0000000000 --- a/examples/authz/servlet-authz/src/main/webapp/protected/admin/onlyAdmin.jsp +++ /dev/null @@ -1,6 +0,0 @@ - - -

Only Administrators can access this page.

- <%@include file="../../logout-include.jsp"%> - - \ No newline at end of file diff --git a/examples/authz/servlet-authz/src/main/webapp/protected/dynamicMenu.jsp b/examples/authz/servlet-authz/src/main/webapp/protected/dynamicMenu.jsp deleted file mode 100644 index 1473d223f3..0000000000 --- a/examples/authz/servlet-authz/src/main/webapp/protected/dynamicMenu.jsp +++ /dev/null @@ -1,48 +0,0 @@ -<%@page import="org.keycloak.AuthorizationContext" %> -<%@ page import="org.keycloak.KeycloakSecurityContext" %> - -<% - KeycloakSecurityContext keycloakSecurityContext = (KeycloakSecurityContext) request.getAttribute(KeycloakSecurityContext.class.getName()); - AuthorizationContext authzContext = keycloakSecurityContext.getAuthorizationContext(); -%> - - - -

Any authenticated user can access this page.

-<%@include file="../logout-include.jsp"%> - -

Here is a dynamic menu built from the permissions returned by the server:

- -
    - <% - if (authzContext.hasResourcePermission("Protected Resource")) { - %> -
  • - Do user thing -
  • - <% - } - %> - - <% - if (authzContext.hasResourcePermission("Premium Resource")) { - %> -
  • - Do user premium thing -
  • - <% - } - %> - - <% - if (authzContext.hasPermission("Admin Resource", "urn:servlet-authz:protected:admin:access")) { - %> -
  • - Do administration thing -
  • - <% - } - %> -
- - \ No newline at end of file diff --git a/examples/authz/servlet-authz/src/main/webapp/protected/premium/onlyPremium.jsp b/examples/authz/servlet-authz/src/main/webapp/protected/premium/onlyPremium.jsp deleted file mode 100644 index 9244f9ca5e..0000000000 --- a/examples/authz/servlet-authz/src/main/webapp/protected/premium/onlyPremium.jsp +++ /dev/null @@ -1,6 +0,0 @@ - - -

Only for premium users.

-<%@include file="../../logout-include.jsp"%> - - \ No newline at end of file diff --git a/examples/pom.xml b/examples/pom.xml index 7572bc4f0a..2313c39b03 100755 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -66,6 +66,5 @@ themes saml ldap - authz diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/authorization/RulesPolicyManagementTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/authorization/RulesPolicyManagementTest.java index 53c68ed390..a784566550 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/authorization/RulesPolicyManagementTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/client/authorization/RulesPolicyManagementTest.java @@ -95,7 +95,7 @@ public class RulesPolicyManagementTest extends AbstractPolicyManagementTest { representation.setDescription("description"); representation.setDecisionStrategy(DecisionStrategy.CONSENSUS); representation.setLogic(Logic.NEGATIVE); - representation.setArtifactGroupId("org.keycloak"); + representation.setArtifactGroupId("org.keycloak.testsuite"); representation.setArtifactId("photoz-authz-policy"); representation.setArtifactVersion(System.getProperty("project.version")); representation.setModuleName("PhotozAuthzOwnerPolicy"); diff --git a/testsuite/integration-arquillian/tests/base/src/test/resources/authorization-test/import-authorization-unordered-settings.json b/testsuite/integration-arquillian/tests/base/src/test/resources/authorization-test/import-authorization-unordered-settings.json index 1d6009023c..5bc497693a 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/resources/authorization-test/import-authorization-unordered-settings.json +++ b/testsuite/integration-arquillian/tests/base/src/test/resources/authorization-test/import-authorization-unordered-settings.json @@ -61,7 +61,7 @@ "mavenArtifactVersion": "${project.version}", "mavenArtifactId": "photoz-authz-policy", "sessionName": "MainOwnerSession", - "mavenArtifactGroupId": "org.keycloak", + "mavenArtifactGroupId": "org.keycloak.testsuite", "moduleName": "PhotozAuthzOwnerPolicy", "scannerPeriod": "1", "scannerPeriodUnit": "Hours" diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authorization/RulePolicyManagementTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authorization/RulePolicyManagementTest.java index a1fbb60b6e..0e6501f3fa 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authorization/RulePolicyManagementTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/authorization/RulePolicyManagementTest.java @@ -88,7 +88,7 @@ public class RulePolicyManagementTest extends AbstractAuthorizationSettingsTest expected.setName(name); expected.setDescription("description"); - expected.setArtifactGroupId("org.keycloak"); + expected.setArtifactGroupId("org.keycloak.testsuite"); expected.setArtifactId("photoz-authz-policy"); expected.setArtifactVersion(Version.VERSION); expected.setModuleName("PhotozAuthzOwnerPolicy"); From 3ade41a76da443d3f3dcb64ef90336ab99238607 Mon Sep 17 00:00:00 2001 From: Alex Szczuczko Date: Wed, 7 Mar 2018 15:26:54 -0700 Subject: [PATCH 31/32] KEYCLOAK-6299 Upstream keycloak-javadocs-pom into the product profile of keycloak-api-docs-dist A product profile has been added to keycloak-api-docs-dist, to replace the downstream product javadocs POM. I've merged in any misc. changes from that pom, but I've kept the upstream zip layout: ``` index.html rest-api/index.html javadocs/index.html javadocs/index-all.html javadocs/* ``` instead of the current product deliverable layout of: ``` META-INF/* index.html index-all.html * ``` The community layout includes the rest-api that's distributed as a separate product deliverable in 7.2.0. I've kept this layout for better artifact consistency, but it could easily be changed to keep the product artifacts consistent for the next product minor version. --- distribution/api-docs-dist/assembly.xml | 1 + distribution/api-docs-dist/pom.xml | 116 ++++++++++++++++++---- distribution/api-docs-dist/src/index.html | 4 +- 3 files changed, 100 insertions(+), 21 deletions(-) diff --git a/distribution/api-docs-dist/assembly.xml b/distribution/api-docs-dist/assembly.xml index f32d988b24..6e4ee6ede1 100755 --- a/distribution/api-docs-dist/assembly.xml +++ b/distribution/api-docs-dist/assembly.xml @@ -39,6 +39,7 @@ src/index.html + true diff --git a/distribution/api-docs-dist/pom.xml b/distribution/api-docs-dist/pom.xml index 59b994e969..88bcf699fe 100755 --- a/distribution/api-docs-dist/pom.xml +++ b/distribution/api-docs-dist/pom.xml @@ -29,13 +29,9 @@ Keycloak Docs Distribution - - - org.keycloak - keycloak-dependencies-server-all - pom - - + + ${product.name.full} ${product.version} + keycloak-api-docs-${project.version} @@ -45,12 +41,9 @@ maven-javadoc-plugin 128m - 1024m - - org.keycloak:* - + 2400m + UTF-8 true - true @@ -75,12 +68,6 @@ assembly.xml - - target - - - target/assembly/work - false @@ -89,7 +76,6 @@ - community @@ -98,8 +84,30 @@ !product + + + org.keycloak + keycloak-dependencies-server-all + pom + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + aggregate-javadoc + + true + + org.keycloak:* + + + + + org.apache.maven.plugins maven-deploy-plugin @@ -110,6 +118,76 @@ + + + product + + + product + + + + + + org.keycloak + keycloak-server-spi + + + org.keycloak + keycloak-common + + + org.keycloak + keycloak-core + + + org.keycloak + keycloak-saml-core-public + + + org.keycloak + keycloak-adapter-spi + + + org.keycloak + keycloak-adapter-core + + + org.keycloak + keycloak-saml-adapter-api-public + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + aggregate-javadoc + + ${javadoc.branding} public API + ${javadoc.branding} public API +
${javadoc.branding}
+
${javadoc.branding}
+ false + + + org.keycloak:keycloak-server-spi + org.keycloak:keycloak-common + org.keycloak:keycloak-core + org.keycloak:keycloak-saml-core-public + org.keycloak:keycloak-adapter-spi + org.keycloak:keycloak-adapter-core + org.keycloak:keycloak-saml-adapter-api-public + +
+
+
+
+
+
+
diff --git a/distribution/api-docs-dist/src/index.html b/distribution/api-docs-dist/src/index.html index 38f86e90fd..97a802881a 100755 --- a/distribution/api-docs-dist/src/index.html +++ b/distribution/api-docs-dist/src/index.html @@ -24,7 +24,7 @@ -

Keyloak API Documentation

+

${product.name.full} API Documentation

@@ -35,4 +35,4 @@ - \ No newline at end of file + From f11c24e3595873091540ebef7acff79e82afef1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Blanchard?= Date: Mon, 19 Mar 2018 22:53:16 +0100 Subject: [PATCH 32/32] [KEYCLOAK-6147] Include Nonce in OIDC authentication --- .../broker/oidc/AbstractOAuth2IdentityProvider.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java b/services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java index a722f8e39e..ef4cb8596a 100755 --- a/services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java +++ b/services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java @@ -59,6 +59,7 @@ import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; import java.io.IOException; import java.net.URI; +import java.util.UUID; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -315,6 +316,13 @@ public abstract class AbstractOAuth2IdentityProvider
Admin REST APIHTML