@c8y/ng1-modules 1017.104.0 → 1017.106.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/ui/sanitize-html/sanitize-html.service.js +1 -1
- package/package.json +1 -1
- package/administration-tfaSettings/cumulocity.json +0 -16
- package/administration-tfaSettings/index.js +0 -1
- package/administration-tfaSettings/tfa-settings.component.js +0 -1
- package/administration-tfaSettings/tfa-settings.html +0 -262
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _slicedToArray(t,r){return _arrayWithHoles(t)||_iterableToArrayLimit(t,r)||_unsupportedIterableToArray(t,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(t,r){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var a,e,o,g,i=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===r){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=o.call(n)).done)&&(i.push(a.value),i.length!==r);l=!0);}catch(t){u=!0,e=t}finally{try{if(!l&&null!=n.return&&(g=n.return(),Object(g)!==g))return}finally{if(u)throw e}}return i}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,r):void 0}}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}!function(){function t(n,t,a){var r=_.memoize(function(t){var r=t.moduleName,n=t.tagName;return function(t){return t.map(function(t){return _.kebabCase(t).replace("c-8-y","c8y")})}(function(t){var e=[];return t.forEach(function(t){var r=angular.module(t)._invokeQueue;0<r.length&&r.forEach(function(t){var r=_slicedToArray(t,3),n=r[1],a=_slicedToArray(r[2],1)[0];"directive"===n&&e.push(a)})}),_.uniq(e)}(c(r))).filter(function(t){return t.includes(n)})},function(t){return t.moduleName}),e={declaration:{regex:{openingTag:/(<\?xml)/g,closingTag:/(\?>)/g},openingTag:"<?xml",closingTag:"?>"}},o=["use","#comment"].concat(_toConsumableArray(_.keys(e))),g=["ngBind","ngBindHtml","ngBindTemplate","ngClass","ngClassEven","ngClassOdd","ngCloak","ngController","ngForm","ngHide","ngIf","ngInclude","ngInit","ngNonBindable","ngPluralize","ngRef","ngRepeat","ngShow","ngStyle","ngSwitch","ngSwitchWhen","ngSwitchDefault","ngOptions","ngTransclude","ngModel","ngList","ngChange","pattern","ngPattern","ngRequired","minlength","ngMinlength","maxlength","ngMaxlength","ngValue","ngModelOptions"].map(_.kebabCase),i="click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(/\s/).map(function(t){return"ng-".concat(t)}),l="click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(/\s/).map(function(t){return"on".concat(t)}),u={ADD_TAGS:_.concat(r({moduleName:"app",tagName:"c8y"}),o),ADD_ATTR:[].concat(_toConsumableArray(g),_toConsumableArray(i),_toConsumableArray(l),["ng-attr-accent-height","ng-attr-accumulate","ng-attr-additive","ng-attr-alignment-baseline","ng-attr-ascent","ng-attr-attributename","ng-attr-attributetype","ng-attr-azimuth","ng-attr-basefrequency","ng-attr-baseline-shift","ng-attr-begin","ng-attr-bias","ng-attr-by","ng-attr-class","ng-attr-clip","ng-attr-clip-path","ng-attr-clip-rule","ng-attr-color","ng-attr-color-interpolation","ng-attr-color-interpolation-filters","ng-attr-color-profile","ng-attr-color-rendering","ng-attr-cx","ng-attr-cy","ng-attr-d","ng-attr-dx","ng-attr-dy","ng-attr-diffuseconstant","ng-attr-direction","ng-attr-display","ng-attr-divisor","ng-attr-dur","ng-attr-edgemode","ng-attr-elevation","ng-attr-end","ng-attr-fill","ng-attr-fill-opacity","ng-attr-fill-rule","ng-attr-filter","ng-attr-filterunits","ng-attr-flood-color","ng-attr-flood-opacity","ng-attr-font-family","ng-attr-font-size","ng-attr-font-size-adjust","ng-attr-font-stretch","ng-attr-font-style","ng-attr-font-variant","ng-attr-font-weight","ng-attr-fx","ng-attr-fy","ng-attr-g1","ng-attr-g2","ng-attr-glyph-name","ng-attr-glyphref","ng-attr-gradientunits","ng-attr-gradienttransform","ng-attr-height","ng-attr-href","ng-attr-id","ng-attr-image-rendering","ng-attr-in","ng-attr-in2","ng-attr-k","ng-attr-k1","ng-attr-k2","ng-attr-k3","ng-attr-k4","ng-attr-kerning","ng-attr-keypoints","ng-attr-keysplines","ng-attr-keytimes","ng-attr-lang","ng-attr-lengthadjust","ng-attr-letter-spacing","ng-attr-kernelmatrix","ng-attr-kernelunitlength","ng-attr-lighting-color","ng-attr-local","ng-attr-marker-end","ng-attr-marker-mid","ng-attr-marker-start","ng-attr-markerheight","ng-attr-markerunits","ng-attr-markerwidth","ng-attr-maskcontentunits","ng-attr-maskunits","ng-attr-max","ng-attr-mask","ng-attr-media","ng-attr-method","ng-attr-mode","ng-attr-min","ng-attr-name","ng-attr-numoctaves","ng-attr-offset","ng-attr-operator","ng-attr-opacity","ng-attr-order","ng-attr-orient","ng-attr-orientation","ng-attr-origin","ng-attr-overflow","ng-attr-paint-order","ng-attr-path","ng-attr-pathlength","ng-attr-patterncontentunits","ng-attr-patterntransform","ng-attr-patternunits","ng-attr-points","ng-attr-preservealpha","ng-attr-preserveaspectratio","ng-attr-primitiveunits","ng-attr-r","ng-attr-rx","ng-attr-ry","ng-attr-radius","ng-attr-refx","ng-attr-refy","ng-attr-repeatcount","ng-attr-repeatdur","ng-attr-restart","ng-attr-result","ng-attr-rotate","ng-attr-scale","ng-attr-seed","ng-attr-shape-rendering","ng-attr-specularconstant","ng-attr-specularexponent","ng-attr-spreadmethod","ng-attr-stddeviation","ng-attr-stitchtiles","ng-attr-stop-color","ng-attr-stop-opacity","ng-attr-stroke-dasharray","ng-attr-stroke-dashoffset","ng-attr-stroke-linecap","ng-attr-stroke-linejoin","ng-attr-stroke-miterlimit","ng-attr-stroke-opacity","ng-attr-stroke","ng-attr-stroke-width","ng-attr-style","ng-attr-surfacescale","ng-attr-tabindex","ng-attr-targetx","ng-attr-targety","ng-attr-transform","ng-attr-text-anchor","ng-attr-text-decoration","ng-attr-text-rendering","ng-attr-textlength","ng-attr-type","ng-attr-u1","ng-attr-u2","ng-attr-unicode","ng-attr-values","ng-attr-viewbox","ng-attr-visibility","ng-attr-version","ng-attr-vert-adv-y","ng-attr-vert-origin-x","ng-attr-vert-origin-y","ng-attr-width","ng-attr-word-spacing","ng-attr-wrap","ng-attr-writing-mode","ng-attr-xchannelselector","ng-attr-ychannelselector","ng-attr-x","ng-attr-x1","ng-attr-x2","ng-attr-xmlns","ng-attr-y","ng-attr-y1","ng-attr-y2","ng-attr-z","ng-attr-zoomandpan"],_toConsumableArray(r({moduleName:"app",tagName:"c8y"})))};return{sanitizeString:s,getSpecificHtmlTags:r,getModulesList:c,sanitizeFileByLevel:function(t,r){var n=a.defer();return n.resolve(t),"strict"!==r?"lax"!==r?n.promise:this.sanitizeFile(t):this.sanitizeFile(t,{})},sanitizeFile:function(r){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:u;return t.readDataUri(r).then(t.decodeDataUri).then(function(t){return s(t,n)}).then(function(t){return new File([t],r.name,{type:r.type})})}};function s(t){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:u;return function(t){var n=t;return _.forEach(e,function(t,r){n=n.replace(new RegExp("<".concat(r,">"),"g"),t.openingTag).replace(new RegExp("</".concat(r,">"),"g"),t.closingTag)}),n}(n.sanitize(function(t){var a=t;return _.forEach(e,function(t,r){var n=t.regex;a=a.replace(n.openingTag,"<".concat(r,">")).replace(n.closingTag,"</".concat(r,">")).replace(
|
|
1
|
+
"use strict";function _slicedToArray(t,r){return _arrayWithHoles(t)||_iterableToArrayLimit(t,r)||_unsupportedIterableToArray(t,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(t,r){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var a,e,o,g,i=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===r){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=o.call(n)).done)&&(i.push(a.value),i.length!==r);l=!0);}catch(t){u=!0,e=t}finally{try{if(!l&&null!=n.return&&(g=n.return(),Object(g)!==g))return}finally{if(u)throw e}}return i}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,r):void 0}}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,a=new Array(r);n<r;n++)a[n]=t[n];return a}!function(){function t(n,t,a){var r=_.memoize(function(t){var r=t.moduleName,n=t.tagName;return function(t){return t.map(function(t){return _.kebabCase(t).replace("c-8-y","c8y")})}(function(t){var e=[];return t.forEach(function(t){var r=angular.module(t)._invokeQueue;0<r.length&&r.forEach(function(t){var r=_slicedToArray(t,3),n=r[1],a=_slicedToArray(r[2],1)[0];"directive"===n&&e.push(a)})}),_.uniq(e)}(c(r))).filter(function(t){return t.includes(n)})},function(t){return t.moduleName}),e={declaration:{regex:{openingTag:/(<\?xml)/g,closingTag:/(\?>)/g,sandboxEscape:/constructor.constructor.+?(?=\}\})/gim},openingTag:"<?xml",closingTag:"?>"}},o=["use","#comment"].concat(_toConsumableArray(_.keys(e))),g=["ngBind","ngBindHtml","ngBindTemplate","ngClass","ngClassEven","ngClassOdd","ngCloak","ngController","ngForm","ngHide","ngIf","ngInclude","ngInit","ngNonBindable","ngPluralize","ngRef","ngRepeat","ngShow","ngStyle","ngSwitch","ngSwitchWhen","ngSwitchDefault","ngOptions","ngTransclude","ngModel","ngList","ngChange","pattern","ngPattern","ngRequired","minlength","ngMinlength","maxlength","ngMaxlength","ngValue","ngModelOptions"].map(_.kebabCase),i="click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(/\s/).map(function(t){return"ng-".concat(t)}),l="click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(/\s/).map(function(t){return"on".concat(t)}),u={ADD_TAGS:_.concat(r({moduleName:"app",tagName:"c8y"}),o),ADD_ATTR:[].concat(_toConsumableArray(g),_toConsumableArray(i),_toConsumableArray(l),["ng-attr-accent-height","ng-attr-accumulate","ng-attr-additive","ng-attr-alignment-baseline","ng-attr-ascent","ng-attr-attributename","ng-attr-attributetype","ng-attr-azimuth","ng-attr-basefrequency","ng-attr-baseline-shift","ng-attr-begin","ng-attr-bias","ng-attr-by","ng-attr-class","ng-attr-clip","ng-attr-clip-path","ng-attr-clip-rule","ng-attr-color","ng-attr-color-interpolation","ng-attr-color-interpolation-filters","ng-attr-color-profile","ng-attr-color-rendering","ng-attr-cx","ng-attr-cy","ng-attr-d","ng-attr-dx","ng-attr-dy","ng-attr-diffuseconstant","ng-attr-direction","ng-attr-display","ng-attr-divisor","ng-attr-dur","ng-attr-edgemode","ng-attr-elevation","ng-attr-end","ng-attr-fill","ng-attr-fill-opacity","ng-attr-fill-rule","ng-attr-filter","ng-attr-filterunits","ng-attr-flood-color","ng-attr-flood-opacity","ng-attr-font-family","ng-attr-font-size","ng-attr-font-size-adjust","ng-attr-font-stretch","ng-attr-font-style","ng-attr-font-variant","ng-attr-font-weight","ng-attr-fx","ng-attr-fy","ng-attr-g1","ng-attr-g2","ng-attr-glyph-name","ng-attr-glyphref","ng-attr-gradientunits","ng-attr-gradienttransform","ng-attr-height","ng-attr-href","ng-attr-id","ng-attr-image-rendering","ng-attr-in","ng-attr-in2","ng-attr-k","ng-attr-k1","ng-attr-k2","ng-attr-k3","ng-attr-k4","ng-attr-kerning","ng-attr-keypoints","ng-attr-keysplines","ng-attr-keytimes","ng-attr-lang","ng-attr-lengthadjust","ng-attr-letter-spacing","ng-attr-kernelmatrix","ng-attr-kernelunitlength","ng-attr-lighting-color","ng-attr-local","ng-attr-marker-end","ng-attr-marker-mid","ng-attr-marker-start","ng-attr-markerheight","ng-attr-markerunits","ng-attr-markerwidth","ng-attr-maskcontentunits","ng-attr-maskunits","ng-attr-max","ng-attr-mask","ng-attr-media","ng-attr-method","ng-attr-mode","ng-attr-min","ng-attr-name","ng-attr-numoctaves","ng-attr-offset","ng-attr-operator","ng-attr-opacity","ng-attr-order","ng-attr-orient","ng-attr-orientation","ng-attr-origin","ng-attr-overflow","ng-attr-paint-order","ng-attr-path","ng-attr-pathlength","ng-attr-patterncontentunits","ng-attr-patterntransform","ng-attr-patternunits","ng-attr-points","ng-attr-preservealpha","ng-attr-preserveaspectratio","ng-attr-primitiveunits","ng-attr-r","ng-attr-rx","ng-attr-ry","ng-attr-radius","ng-attr-refx","ng-attr-refy","ng-attr-repeatcount","ng-attr-repeatdur","ng-attr-restart","ng-attr-result","ng-attr-rotate","ng-attr-scale","ng-attr-seed","ng-attr-shape-rendering","ng-attr-specularconstant","ng-attr-specularexponent","ng-attr-spreadmethod","ng-attr-stddeviation","ng-attr-stitchtiles","ng-attr-stop-color","ng-attr-stop-opacity","ng-attr-stroke-dasharray","ng-attr-stroke-dashoffset","ng-attr-stroke-linecap","ng-attr-stroke-linejoin","ng-attr-stroke-miterlimit","ng-attr-stroke-opacity","ng-attr-stroke","ng-attr-stroke-width","ng-attr-style","ng-attr-surfacescale","ng-attr-tabindex","ng-attr-targetx","ng-attr-targety","ng-attr-transform","ng-attr-text-anchor","ng-attr-text-decoration","ng-attr-text-rendering","ng-attr-textlength","ng-attr-type","ng-attr-u1","ng-attr-u2","ng-attr-unicode","ng-attr-values","ng-attr-viewbox","ng-attr-visibility","ng-attr-version","ng-attr-vert-adv-y","ng-attr-vert-origin-x","ng-attr-vert-origin-y","ng-attr-width","ng-attr-word-spacing","ng-attr-wrap","ng-attr-writing-mode","ng-attr-xchannelselector","ng-attr-ychannelselector","ng-attr-x","ng-attr-x1","ng-attr-x2","ng-attr-xmlns","ng-attr-y","ng-attr-y1","ng-attr-y2","ng-attr-z","ng-attr-zoomandpan"],_toConsumableArray(r({moduleName:"app",tagName:"c8y"})))};return{sanitizeString:s,getSpecificHtmlTags:r,getModulesList:c,sanitizeFileByLevel:function(t,r){var n=a.defer();return n.resolve(t),"strict"!==r?"lax"!==r?n.promise:this.sanitizeFile(t):this.sanitizeFile(t,{})},sanitizeFile:function(r){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:u;return t.readDataUri(r).then(t.decodeDataUri).then(function(t){return s(t,n)}).then(function(t){return new File([t],r.name,{type:r.type})})}};function s(t){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:u;return function(t){var n=t;return _.forEach(e,function(t,r){n=n.replace(new RegExp("<".concat(r,">"),"g"),t.openingTag).replace(new RegExp("</".concat(r,">"),"g"),t.closingTag)}),n}(n.sanitize(function(t){var a=t;return _.forEach(e,function(t,r){var n=t.regex;a=a.replace(n.openingTag,"<".concat(r,">")).replace(n.closingTag,"</".concat(r,">")).replace(n.sandboxEscape,"")}),a}(t),r))}function c(r){var t=angular.module(r).requires.reduce(d,[]);return-1===_.findIndex(t,function(t){return t===r})&&t.push(r),_.uniq(t)}function d(t,r){if("string"!=typeof r)return t;var n=angular.module(r);return 0<n.requires.length?_.includes(t,r)?t:(t.push(r),n.requires.reduce(d,t)):(t.push(r),t)}}t.$inject=["DOMPurify","c8yBinary","$q"],angular.module("c8y.ui").constant("DOMPurify",window.DOMPurify),angular.module("c8y.ui").factory("c8ySanitizeHtml",t)}();
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "TFA Settings",
|
|
3
|
-
"ngModules": [
|
|
4
|
-
"c8y.parts.tfaSettings"
|
|
5
|
-
],
|
|
6
|
-
"category": "Administration",
|
|
7
|
-
"description": "Configure TFA settings via UI",
|
|
8
|
-
"js": [
|
|
9
|
-
"index.js",
|
|
10
|
-
"tfa-settings.component.js"
|
|
11
|
-
],
|
|
12
|
-
"folderName": "tfaSettings",
|
|
13
|
-
"appsInclude": [
|
|
14
|
-
"administration"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";angular.module("c8y.parts.tfaSettings",[]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(r,e,o,i,t,a,u,l,s,y){var c=this,n="two-factor-authentication",f=y("TOTP requires OAI-Secure login mode."),d=y("TOTP requires Allow two-factor authentication enabled."),p=y("Messaging application is not subscribed."),m=y("The setting is enforced on the platform level."),g=y("In OAI-Secure login mode, the token's validity limit is determined by the JWT token and cannot be edited here."),b=[{systemOption:!0,key:"tenant-scope-settings.enabled",default:!1,readOnly:!0},{key:"enabled",default:!1,loader:P},{key:"token.validity",default:43200,readOnlyIfTenantScopeSettingsDisabled:!0},{key:"pin.validity",default:30,readOnlyIfTenantScopeSettingsDisabled:!0},{key:"enforced",default:!1,loader:P}],v=[{key:"enabledOnSystemLevel",default:!1},{key:"enabledOnTenantLevel",default:!1},{key:"enforcedOnSystemLevel",default:!1},{key:"enforcedUsersGroup",default:""},{key:"strategy",default:"SMS"},{key:"totpEnforcedOnTenantLevel",default:!1}];function S(t){var e=h(t),n=t.default;return(t.systemOption?i.getSystemOptionValue(e,n):"function"==typeof t.loader?t.loader():i.detailValue(e,n)).then(function(e){return A(t,e)}).catch(function(){return A(t,t.default)})}function h(e){return{category:n,key:e.key}}function A(e,t){c[T(e.key)]=t,c.previousSettings[T(e.key)]=_.cloneDeep(t)}function T(e){return _.camelCase(e)}function k(e){var t={category:n,key:e.key,value:O(e)};return function(e){var t="enabled"===e.key||I(),n=c.previousSettings[T(e.key)]!==O(e),r=e.readOnly,o=e.readOnlyIfTenantScopeSettingsDisabled&&!c.tenantScopeSettingsEnabled;return n&&t&&!e.systemOption&&!(r||o)}(e)?i.updateOption(t).then(function(){return A(e,t.value)}):r.when()}function O(e){return function(e){return _.isNumber(e)||!_.isNaN(_.toNumber(e))&&_.isString(e)?_.toNumber(e):e}(c[T(e.key)])}function P(){var t=this,n=h(this);return i.getSystemOptionValue(n,this.default).then(function(e){return!0===e||"true"===_.lowerCase(e)?t.readOnly=!0:i.detailValue(n,t.default)})}function I(){return c.enabled||c.enforcedOnSystemLevel||!_.isEmpty(c.enforcedUsersGroup)}_.assign(c,{$onInit:function(){v.forEach(function(e){_.assign(c,_defineProperty({},e.key,e.default))}),r.all([r.all([].concat(_toConsumableArray(_.map(b,S)),[void e.isAvailable({contextPath:"messaging"}).then(function(e){c.smsAppAvailable=e})])),a.current().then(function(e){return u.getTfaSettings(e)}).then(function(t){return v.forEach(function(e){t[e.key]&&A(e,t[e.key])})})]).finally(function(){c.initialized=!0})},saveSettings:function(t){c.enabled&&"TOTP"===c.strategy||(c.enforced=!1);var n=c.previousSettings.strategy!==c.strategy&&I(),e=function(){var e=[].concat(_toConsumableArray(_.map(b,k)),[n?a.current().then(function(e){return u.updateTfaSettings(e,c.strategy)}):r.resolve()]);return r.all(e).then(function(){l.success(y("TFA settings saved.")),t&&t.$setPristine()})};return(n?s.requireLogout(e):e()).catch(function(e){"canceled"!==e&&l.danger(o.getResErrorMessage(e))})},limitValidityRegex:/^[0-9]\d*$/,initialized:!1,totpPopover:f,tfaIsDisabled:d,smsWarningPopover:p,enforcedOnSystemLevelPopover:m,disabledValidityLimitPopover:g,oAuthLoginMode:function(){return c.loginMode===t.loginOptions.OAUTH2_INTERNAL.value.toUpperCase()},isReadOnly:function(r){return b.some(function(e){var t=e.key,n=e.readOnly;return t===r&&n})},isTFAEnabled:I,previousSettings:{}})}e.$inject=["$q","c8yApplication","c8yBase","c8ySettings","c8yLoginOptions","c8yTenant","c8yTfaSettings","c8yAlert","c8yUserUtil","gettext"],angular.module("c8y.parts.tfaSettings").component("c8yTfaSettings",{controller:e,controllerAs:"vm",templateUrl:":::PLUGIN_PATH:::/tfa-settings.html",bindings:{loginMode:"<"}})}();
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
<div class="card">
|
|
2
|
-
<div class="card-header">
|
|
3
|
-
<div class="card-title" translate>
|
|
4
|
-
<span title="Two-factor authentication">TFA</span>
|
|
5
|
-
settings
|
|
6
|
-
</div>
|
|
7
|
-
</div>
|
|
8
|
-
<hr />
|
|
9
|
-
<div class="card-block" ng-show="vm.initialized">
|
|
10
|
-
<form name="tfaSettingsForm">
|
|
11
|
-
<div class="form-group">
|
|
12
|
-
<label
|
|
13
|
-
class="c8y-checkbox"
|
|
14
|
-
ng-class="{
|
|
15
|
-
disabled: vm.isReadOnly('enabled') || vm.enforcedOnSystemLevel || vm.enforcedUsersGroup
|
|
16
|
-
}"
|
|
17
|
-
>
|
|
18
|
-
<input
|
|
19
|
-
ng-if="vm.enforcedOnSystemLevel || vm.enforcedUsersGroup"
|
|
20
|
-
type="checkbox"
|
|
21
|
-
checked
|
|
22
|
-
disabled
|
|
23
|
-
/>
|
|
24
|
-
<input
|
|
25
|
-
ng-if="!vm.enforcedOnSystemLevel && !vm.enforcedUsersGroup"
|
|
26
|
-
type="checkbox"
|
|
27
|
-
ng-model="vm.enabled"
|
|
28
|
-
ng-disabled="vm.isReadOnly('enabled')"
|
|
29
|
-
/>
|
|
30
|
-
<span></span>
|
|
31
|
-
<span>{{ 'Allow two-factor authentication' | translate }}</span>
|
|
32
|
-
<button
|
|
33
|
-
type="button"
|
|
34
|
-
class="btn-help btn-help--sm"
|
|
35
|
-
aria-label="{{ 'Help' | translate }}"
|
|
36
|
-
popover-trigger="'focus'"
|
|
37
|
-
popover-append-to-body="true"
|
|
38
|
-
popover-placement="right"
|
|
39
|
-
uib-popover-html="vm.enforcedOnSystemLevelPopover | translate"
|
|
40
|
-
ng-if="vm.isReadOnly('enabled') || vm.enforcedOnSystemLevel || vm.enforcedUsersGroup"
|
|
41
|
-
></button>
|
|
42
|
-
</label>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
<fieldset ng-disabled="!vm.isTFAEnabled()">
|
|
46
|
-
<div class="form-group">
|
|
47
|
-
<label
|
|
48
|
-
title="{{ 'SMS based' | translate }}"
|
|
49
|
-
class="c8y-radio radio-inline"
|
|
50
|
-
ng-class="{ disabled: !vm.smsAppAvailable }"
|
|
51
|
-
>
|
|
52
|
-
<input
|
|
53
|
-
type="radio"
|
|
54
|
-
value="SMS"
|
|
55
|
-
ng-model="vm.strategy"
|
|
56
|
-
ng-disabled="!vm.smsAppAvailable"
|
|
57
|
-
/>
|
|
58
|
-
<span></span>
|
|
59
|
-
<span>{{ 'SMS based' | translate }}</span>
|
|
60
|
-
<a
|
|
61
|
-
ng-show="!vm.smsAppAvailable"
|
|
62
|
-
href=""
|
|
63
|
-
class="text-warning"
|
|
64
|
-
popover-trigger="'focus'"
|
|
65
|
-
popover-append-to-body="true"
|
|
66
|
-
popover-placement="right"
|
|
67
|
-
uib-popover-html="vm.smsWarningPopover | translate"
|
|
68
|
-
>
|
|
69
|
-
<i c8y-icon="exclamation-triangle"></i>
|
|
70
|
-
</a>
|
|
71
|
-
</label>
|
|
72
|
-
<label
|
|
73
|
-
title="{{ 'Google Authenticator (TOTP)' | translate }}"
|
|
74
|
-
class="c8y-radio radio-inline"
|
|
75
|
-
ng-class="{ disabled: !vm.oAuthLoginMode() }"
|
|
76
|
-
>
|
|
77
|
-
<input
|
|
78
|
-
type="radio"
|
|
79
|
-
value="TOTP"
|
|
80
|
-
ng-model="vm.strategy"
|
|
81
|
-
ng-disabled="!vm.oAuthLoginMode() || !vm.isTFAEnabled()"
|
|
82
|
-
/>
|
|
83
|
-
<span></span>
|
|
84
|
-
<span>{{ 'Google Authenticator (TOTP)' | translate }}</span>
|
|
85
|
-
<button
|
|
86
|
-
ng-if="vm.enabled"
|
|
87
|
-
type="button"
|
|
88
|
-
class="btn-help btn-help--sm"
|
|
89
|
-
aria-label="{{ 'Help' | translate }}"
|
|
90
|
-
popover-trigger="'focus'"
|
|
91
|
-
popover-append-to-body="true"
|
|
92
|
-
popover-placement="right"
|
|
93
|
-
uib-popover-html="vm.totpPopover | translate"
|
|
94
|
-
></button>
|
|
95
|
-
<button
|
|
96
|
-
ng-if="!vm.enabled"
|
|
97
|
-
type="button"
|
|
98
|
-
class="btn-help btn-help--sm"
|
|
99
|
-
aria-label="{{ 'Help' | translate }}"
|
|
100
|
-
popover-trigger="'focus'"
|
|
101
|
-
popover-append-to-body="true"
|
|
102
|
-
popover-placement="right"
|
|
103
|
-
uib-popover-html="vm.tfaIsDisabled | translate"
|
|
104
|
-
></button>
|
|
105
|
-
</label>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
<div class="row" ng-if="vm.strategy === 'SMS'">
|
|
109
|
-
<div class="col-sm-6">
|
|
110
|
-
<div
|
|
111
|
-
class="form-group"
|
|
112
|
-
ng-class="{
|
|
113
|
-
'has-error':
|
|
114
|
-
vm.tfaSettingsForm.tokenValidity.$dirty &&
|
|
115
|
-
vm.tfaSettingsForm.tokenValidity.$invalid
|
|
116
|
-
}"
|
|
117
|
-
>
|
|
118
|
-
<label>
|
|
119
|
-
{{ 'Limit token validity for' | translate }}
|
|
120
|
-
<button
|
|
121
|
-
ng-if="!vm.tenantScopeSettingsEnabled"
|
|
122
|
-
type="button"
|
|
123
|
-
class="btn-help btn-help--sm"
|
|
124
|
-
aria-label="{{ 'Help' | translate }}"
|
|
125
|
-
popover-trigger="'focus'"
|
|
126
|
-
popover-append-to-body="true"
|
|
127
|
-
popover-placement="right"
|
|
128
|
-
uib-popover-html="vm.enforcedOnSystemLevelPopover | translate"
|
|
129
|
-
></button>
|
|
130
|
-
<button
|
|
131
|
-
ng-if="vm.loginMode === 'OAUTH2_INTERNAL'"
|
|
132
|
-
type="button"
|
|
133
|
-
class="btn-help btn-help--sm"
|
|
134
|
-
aria-label="{{ 'Help' | translate }}"
|
|
135
|
-
popover-trigger="'focus'"
|
|
136
|
-
popover-append-to-body="true"
|
|
137
|
-
popover-placement="right"
|
|
138
|
-
uib-popover-html="vm.disabledValidityLimitPopover | translate"
|
|
139
|
-
></button>
|
|
140
|
-
</label>
|
|
141
|
-
<div class="input-group">
|
|
142
|
-
<input
|
|
143
|
-
class="form-control text-right"
|
|
144
|
-
name="tokenValidity"
|
|
145
|
-
maxlength="6"
|
|
146
|
-
ng-model="vm.tokenValidity"
|
|
147
|
-
ng-pattern="vm.limitValidityRegex"
|
|
148
|
-
ng-disabled="!vm.tenantScopeSettingsEnabled || vm.loginMode === 'OAUTH2_INTERNAL'"
|
|
149
|
-
placeholder="{{ 'e.g.' | translate }} 43200"
|
|
150
|
-
ng-required="vm.tenantScopeSettingsEnabled"
|
|
151
|
-
/>
|
|
152
|
-
<span class="input-group-addon" translate>minutes</span>
|
|
153
|
-
</div>
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
</div>
|
|
157
|
-
<div class="row" ng-if="vm.strategy === 'SMS'">
|
|
158
|
-
<div class="col-sm-6">
|
|
159
|
-
<div
|
|
160
|
-
class="form-group"
|
|
161
|
-
ng-class="{
|
|
162
|
-
'has-error':
|
|
163
|
-
vm.tfaSettingsForm.pinValidity.$dirty && vm.tfaSettingsForm.pinValidity.$invalid
|
|
164
|
-
}"
|
|
165
|
-
>
|
|
166
|
-
<label>
|
|
167
|
-
{{ 'Limit verification code validity for' | translate }}
|
|
168
|
-
<button
|
|
169
|
-
ng-if="!vm.tenantScopeSettingsEnabled"
|
|
170
|
-
type="button"
|
|
171
|
-
class="btn-help btn-help--sm"
|
|
172
|
-
aria-label="{{ 'Help' | translate }}"
|
|
173
|
-
popover-trigger="'focus'"
|
|
174
|
-
popover-append-to-body="true"
|
|
175
|
-
popover-placement="right"
|
|
176
|
-
uib-popover-html="vm.enforcedOnSystemLevelPopover | translate"
|
|
177
|
-
></button>
|
|
178
|
-
</label>
|
|
179
|
-
<div class="input-group">
|
|
180
|
-
<input
|
|
181
|
-
class="form-control text-right"
|
|
182
|
-
maxlength="6"
|
|
183
|
-
name="pinValidity"
|
|
184
|
-
ng-model="vm.pinValidity"
|
|
185
|
-
ng-pattern="vm.limitValidityRegex"
|
|
186
|
-
ng-disabled="!vm.tenantScopeSettingsEnabled"
|
|
187
|
-
placeholder="{{ 'e.g.' | translate }} 30"
|
|
188
|
-
ng-required="vm.tenantScopeSettingsEnabled"
|
|
189
|
-
/>
|
|
190
|
-
<span class="input-group-addon" translate>minutes</span>
|
|
191
|
-
</div>
|
|
192
|
-
</div>
|
|
193
|
-
</div>
|
|
194
|
-
</div>
|
|
195
|
-
|
|
196
|
-
<label
|
|
197
|
-
ng-if="vm.enforcedUsersGroup && !vm.enforcedOnSystemLevel"
|
|
198
|
-
class="c8y-checkbox disabled"
|
|
199
|
-
>
|
|
200
|
-
<input type="checkbox" checked disabled />
|
|
201
|
-
<span></span>
|
|
202
|
-
<span translate>
|
|
203
|
-
Enforce two-factor authentication on users with role {{ vm.enforcedUsersGroup }}.
|
|
204
|
-
</span>
|
|
205
|
-
<button
|
|
206
|
-
type="button"
|
|
207
|
-
class="btn-help btn-help--sm"
|
|
208
|
-
aria-label="{{ 'Help' | translate }}"
|
|
209
|
-
popover-trigger="'focus'"
|
|
210
|
-
popover-append-to-body="true"
|
|
211
|
-
popover-placement="right"
|
|
212
|
-
uib-popover-html="vm.enforcedOnSystemLevelPopover | translate"
|
|
213
|
-
></button>
|
|
214
|
-
</label>
|
|
215
|
-
|
|
216
|
-
<label ng-if="vm.enforcedOnSystemLevel" class="c8y-checkbox disabled">
|
|
217
|
-
<input type="checkbox" checked disabled />
|
|
218
|
-
<span></span>
|
|
219
|
-
<span>
|
|
220
|
-
{{ 'Enforce two-factor authentication on all users' | translate }}
|
|
221
|
-
</span>
|
|
222
|
-
<button
|
|
223
|
-
ng-if="vm.enforcedOnSystemLevel"
|
|
224
|
-
type="button"
|
|
225
|
-
class="btn-help btn-help--sm"
|
|
226
|
-
aria-label="{{ 'Help' | translate }}"
|
|
227
|
-
popover-trigger="'focus'"
|
|
228
|
-
popover-append-to-body="true"
|
|
229
|
-
popover-placement="right"
|
|
230
|
-
uib-popover-html="vm.enforcedOnSystemLevelPopover | translate"
|
|
231
|
-
></button>
|
|
232
|
-
</label>
|
|
233
|
-
|
|
234
|
-
<label
|
|
235
|
-
title="{{ 'Enforce two-factor authentication on all users' | translate }}"
|
|
236
|
-
ng-if="!vm.enforcedOnSystemLevel && vm.strategy === 'TOTP'"
|
|
237
|
-
class="c8y-checkbox"
|
|
238
|
-
ng-class="{ disabled: !vm.enabled || vm.isReadOnly('enforced') }"
|
|
239
|
-
>
|
|
240
|
-
<input
|
|
241
|
-
type="checkbox"
|
|
242
|
-
ng-model="vm.enforced"
|
|
243
|
-
ng-disabled="(!vm.enabled || vm.isReadOnly('enforced'))"
|
|
244
|
-
/>
|
|
245
|
-
<span></span>
|
|
246
|
-
<span>{{ 'Enforce two-factor authentication on all users' | translate }}</span>
|
|
247
|
-
</label>
|
|
248
|
-
</fieldset>
|
|
249
|
-
</form>
|
|
250
|
-
</div>
|
|
251
|
-
<div class="card-footer">
|
|
252
|
-
<button
|
|
253
|
-
title="{{ 'Save TFA settings' | translate }}"
|
|
254
|
-
type="button"
|
|
255
|
-
class="btn btn-primary"
|
|
256
|
-
ng-disabled="tfaSettingsForm.$invalid || tfaSettingsForm.$pristine"
|
|
257
|
-
ng-click="vm.saveSettings(tfaSettingsForm)"
|
|
258
|
-
>
|
|
259
|
-
{{ 'Save TFA settings' | translate }}
|
|
260
|
-
</button>
|
|
261
|
-
</div>
|
|
262
|
-
</div>
|