duo_web 1.0.1 → 1.0.3
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.
- checksums.yaml +5 -5
- data/js/Duo-Web-v2.js +4 -4
- data/js/Duo-Web-v2.min.js +1 -1
- data/lib/duo_web.rb +5 -0
- metadata +7 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: c70cb013ea72192e2a4b2d14ccfb380174f1bf14f0759dfbf9ce12cf237bcc4d
|
|
4
|
+
data.tar.gz: b7ebdc7fb3437ece9f45e2f4532dfff1a30c69ccccfcb99d9ef035712ab0e77f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bfd2827efeb2efcccbc2eb25b76310890c54c7c38688e8d4b5e56a2a3e305bb083610016946d67b82d03904e45935d5c912b47f7aadcd68f4242011dd5a1b291
|
|
7
|
+
data.tar.gz: 3823882095cbde2206e0e5c1db43f1cf14f99d828a1eef4e9903f2aa33dc4035244ce22baf1c338e5b0adf3c5402e20d45114001a95549abfc35c454adfadc10
|
data/js/Duo-Web-v2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Duo Web SDK v2
|
|
3
|
-
* Copyright
|
|
3
|
+
* Copyright 2021, Duo Security
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
(function (root, factory) {
|
|
@@ -380,9 +380,9 @@
|
|
|
380
380
|
*/
|
|
381
381
|
function generateIframeSrc() {
|
|
382
382
|
return [
|
|
383
|
-
'https://', host, '/frame/web/v1/auth?tx=', duoSig,
|
|
383
|
+
'https://', host, '/frame/web/v1/auth?tx=', encodeURIComponent(duoSig),
|
|
384
384
|
'&parent=', encodeURIComponent(document.location.href),
|
|
385
|
-
'&v=2.
|
|
385
|
+
'&v=2.9'
|
|
386
386
|
].join('');
|
|
387
387
|
}
|
|
388
388
|
|
|
@@ -512,7 +512,7 @@
|
|
|
512
512
|
while (promptElement.firstChild) {
|
|
513
513
|
// We call `removeChild()` instead of doing `innerHTML = ""`
|
|
514
514
|
// to make sure we unbind any events.
|
|
515
|
-
promptElement.removeChild(promptElement.firstChild)
|
|
515
|
+
promptElement.removeChild(promptElement.firstChild);
|
|
516
516
|
}
|
|
517
517
|
|
|
518
518
|
iframe = document.createElement('iframe');
|
data/js/Duo-Web-v2.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){if("function"==typeof define&&define.amd)define([],t);else if("object"==typeof module&&module.exports)module.exports=t();else{var n=t();n._onReady(n.init),e.Duo=n}}(this,function(){var i,a,r,s
|
|
1
|
+
!function(e,t){if("function"==typeof define&&define.amd)define([],t);else if("object"==typeof module&&module.exports)module.exports=t();else{var n=t();n._onReady(n.init),e.Duo=n}}(this,function(){var e,t,n,o,i,a,r,s=/^(?:AUTH|ENROLL)+\|[A-Za-z0-9\+\/=]+\|[A-Za-z0-9\+\/=]+$/,u=/^ERR\|[\w\s\.\(\)]+$/,m=/^DUO_OPEN_WINDOW\|/,d=["duo.com","duosecurity.com","duomobile.s3-us-west-1.amazonaws.com"];function f(){e="",t="sig_response",n=undefined,undefined,o=undefined,i=undefined,a=undefined,r=undefined}function c(e,t){var n=t||"https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe";throw new Error("Duo Web SDK error: "+e+(n?"\nSee "+n+" for more information":""))}function l(e,t){return"dataset"in e?e.dataset[t]:e.getAttribute("data-"+t.replace(/([a-z])([A-Z])/,"$1-$2").toLowerCase())}function h(e,t,n,o){"addEventListener"in window?e.addEventListener(t,o,!1):e.attachEvent(n,o)}function g(e,t,n,o){"removeEventListener"in window?e.removeEventListener(t,o,!1):e.detachEvent(n,o)}function p(e){h(document,"DOMContentLoaded","onreadystatechange",e)}function v(e){g(document,"DOMContentLoaded","onreadystatechange",e)}function w(e){if(e){0===e.indexOf("ERR|")&&c(e.split("|")[1]),-1!==e.indexOf(":")&&2===e.split(":").length||c("Duo was given a bad token. This might indicate a configuration problem with one of Duo's client libraries.");var t=e.split(":");return e,o=t[0],i=t[1],{sigRequest:e,duoSig:t[0],appSig:t[1]}}}function _(e){return Boolean(e.origin==="https://"+n&&"string"==typeof e.data&&(e.data.match(s)||e.data.match(u)||e.data.match(m)))}function b(e){var t,n;return e.iframe&&e.iframeContainer?c("Passing both `iframe` and `iframeContainer` arguments at the same time is not allowed."):e.iframe?(t=E(e.iframe),(n=t)&&!y(n)&&c("`iframe` only accepts an iframe element or the id of an iframe. To use a non-iframe element, use the `iframeContainer` argument.")):e.iframeContainer?function(e){e&&y(e)&&c("`iframeContainer` only accepts a non-iframe element or the id of a non-iframe. To use a non-iframe element, use the `iframeContainer` argument on Duo.init().")}(t=E(e.iframeContainer)):t=document.getElementById("duo_iframe"),t}function E(e){return e.tagName?e:"string"==typeof e?document.getElementById(e):null}function y(e){return e&&e.tagName&&"iframe"===e.tagName.toLowerCase()}function C(){return["https://",n,"/frame/web/v1/auth?tx=",encodeURIComponent(o),"&parent=",encodeURIComponent(document.location.href),"&v=2.9"].join("")}function D(e){if(_(e))if(e.data.match(m)){var t=e.data.substring("DUO_OPEN_WINDOW|".length);(function(e){if(!e)return!1;var t=document.createElement("a");if(t.href=e,"duotrustedendpoints:"===t.protocol)return!0;if("https:"!==t.protocol)return!1;for(var n=0;n<d.length;n++)if(t.hostname.endsWith("."+d[n])||t.hostname===d[n])return!0;return!1})(t)&&window.open(t,"_self")}else O(e.data),g(window,"message","onmessage",D)}function A(r,s){if(n||(n=l(r,"host"))||c("No API hostname is given for Duo to use. Be sure to pass a `host` parameter to Duo.init, or through the `data-host` attribute on the iframe element."),o&&i||(w(l(r,"sigRequest")),o&&i||c("No valid signed request is given. Be sure to give the `sig_request` parameter to Duo.init, or use the `data-sig-request` attribute on the iframe element.")),""===e&&(e=l(r,"postAction")||e),"sig_response"===t&&(t=l(r,"postArgument")||t),y(r))(a=r).src=C();else{for(;r.firstChild;)r.removeChild(r.firstChild);for(var u in a=document.createElement("iframe"),s.src=C(),s)a.setAttribute(u,s[u]);r.appendChild(a)}h(window,"message","onmessage",D)}function O(n){var o=document.createElement("input");o.type="hidden",o.name=t,o.value=n+":"+i;var s=document.getElementById("duo_form");s||(s=document.createElement("form"),a.parentElement.insertBefore(s,a.nextSibling)),s.method="POST",s.action=e,s.appendChild(o),"function"==typeof r?r.call(null,s):s.submit()}return f(),{init:function R(o){f(),o&&(o.host&&(n=o.host),o.sig_request&&w(o.sig_request),o.post_action&&(e=o.post_action),o.post_argument&&(t=o.post_argument),"function"==typeof o.submit_callback&&(r=o.submit_callback));var i=b(o);i?A(i,o.iframeAttributes||{}):function(e){var t=function(){var n=b(e);n||c('This page does not contain an iframe for Duo to use. Add an element like <iframe id="duo_iframe"></iframe> to this page.'),A(n,e.iframeAttributes||{}),v(t)};p(t)}(o),v(R)},_onReady:p,_parseSigRequest:w,_isDuoMessage:_,_doPostBack:O}});
|
data/lib/duo_web.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: duo_web
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Duo Security
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-07-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -16,28 +16,28 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '13'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '13'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rubocop
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
33
|
+
version: 1.27.0
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
40
|
+
version: 1.27.0
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: test-unit
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -80,8 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
80
80
|
- !ruby/object:Gem::Version
|
|
81
81
|
version: '0'
|
|
82
82
|
requirements: []
|
|
83
|
-
|
|
84
|
-
rubygems_version: 2.5.2.3
|
|
83
|
+
rubygems_version: 3.0.3.1
|
|
85
84
|
signing_key:
|
|
86
85
|
specification_version: 4
|
|
87
86
|
summary: Duo Web Ruby
|