Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurélien Vermylen
jio
Commits
976ca8a4
Commit
976ca8a4
authored
Nov 07, 2017
by
Aurelien Vermylen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make credentials possible in ERP5Storage for nodejs use.
parent
d1895b24
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
39 deletions
+93
-39
dist/jio-v3.23.1.js
dist/jio-v3.23.1.js
+30
-12
dist/jio-v3.23.1.min.js
dist/jio-v3.23.1.min.js
+3
-3
dist/nodejs/jio.js
dist/nodejs/jio.js
+30
-12
src/jio.storage/erp5storage.js
src/jio.storage/erp5storage.js
+30
-12
No files found.
dist/jio-v3.23.1.js
View file @
976ca8a4
...
...
@@ -11368,7 +11368,7 @@ return new Parser;
/*jslint nomen: true, unparam: true */
/*global jIO, UriTemplate, FormData, RSVP, URI, Blob,
SimpleQuery, ComplexQuery*/
SimpleQuery, ComplexQuery
, btoa
*/
(
function
(
jIO
,
UriTemplate
,
FormData
,
RSVP
,
URI
,
Blob
,
SimpleQuery
,
ComplexQuery
)
{
...
...
@@ -11381,8 +11381,9 @@ return new Parser;
"
type
"
:
"
GET
"
,
"
url
"
:
storage
.
_url
,
"
xhrFields
"
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
})
.
push
(
function
(
event
)
{
...
...
@@ -11407,8 +11408,9 @@ return new Parser;
view
:
options
.
_view
}),
"
xhrFields
"
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
})
.
push
(
undefined
,
function
(
error
)
{
...
...
@@ -11506,6 +11508,13 @@ return new Parser;
}
this
.
_url
=
spec
.
url
;
this
.
_default_view_reference
=
spec
.
default_view_reference
;
this
.
_headers
=
{};
this
.
_withCredentials
=
true
;
if
(
spec
.
login
!==
undefined
&&
spec
.
password
!==
undefined
)
{
this
.
_headers
=
{
"
Authorization
"
:
"
Basic
"
+
btoa
(
spec
.
login
+
"
:
"
+
spec
.
password
)};
this
.
_withCredentials
=
false
;
}
}
function
convertJSONToGet
(
json
)
{
...
...
@@ -11543,8 +11552,9 @@ return new Parser;
url
:
site_hal
.
_actions
.
add
.
href
,
data
:
form_data
,
xhrFields
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
})
.
push
(
function
(
evt
)
{
...
...
@@ -11658,6 +11668,7 @@ return new Parser;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
var
start
,
k
,
end
,
range
,
request_options
=
{
...
...
@@ -11665,7 +11676,7 @@ return new Parser;
"
dataType
"
:
"
blob
"
,
"
url
"
:
action
,
"
xhrFields
"
:
{
withCredentials
:
t
rue
withCredentials
:
t
his
.
_withCredentials
}
};
if
(
options
.
start
!==
undefined
||
options
.
end
!==
undefined
)
{
...
...
@@ -11687,6 +11698,11 @@ return new Parser;
range
=
"
bytes=
"
+
start
+
"
-
"
+
end
;
}
request_options
.
headers
=
{
Range
:
range
};
for
(
k
in
this
.
_headers
)
{
if
(
this
.
_headers
.
hasOwnProperty
(
k
))
{
request_options
.
headers
[
k
]
=
this
.
_headers
[
k
];
}
}
}
return
jIO
.
util
.
ajax
(
request_options
);
})
...
...
@@ -11746,8 +11762,9 @@ return new Parser;
"
data
"
:
data
,
"
dataType
"
:
"
blob
"
,
"
xhrFields
"
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
});
};
...
...
@@ -11864,8 +11881,9 @@ return new Parser;
local_roles
:
local_roles
}),
"
xhrFields
"
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
})
.
push
(
function
(
response
)
{
...
...
dist/jio-v3.23.1.min.js
View file @
976ca8a4
This source diff could not be displayed because it is too large. You can
view the blob
instead.
dist/nodejs/jio.js
View file @
976ca8a4
...
...
@@ -4268,7 +4268,7 @@ return new Parser;
/*jslint nomen: true, unparam: true */
/*global jIO, UriTemplate, FormData, RSVP, URI, Blob,
SimpleQuery, ComplexQuery*/
SimpleQuery, ComplexQuery
, btoa
*/
(
function
(
jIO
,
UriTemplate
,
FormData
,
RSVP
,
URI
,
Blob
,
SimpleQuery
,
ComplexQuery
)
{
...
...
@@ -4281,8 +4281,9 @@ return new Parser;
"
type
"
:
"
GET
"
,
"
url
"
:
storage
.
_url
,
"
xhrFields
"
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
})
.
push
(
function
(
event
)
{
...
...
@@ -4307,8 +4308,9 @@ return new Parser;
view
:
options
.
_view
}),
"
xhrFields
"
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
})
.
push
(
undefined
,
function
(
error
)
{
...
...
@@ -4406,6 +4408,13 @@ return new Parser;
}
this
.
_url
=
spec
.
url
;
this
.
_default_view_reference
=
spec
.
default_view_reference
;
this
.
_headers
=
{};
this
.
_withCredentials
=
true
;
if
(
spec
.
login
!==
undefined
&&
spec
.
password
!==
undefined
)
{
this
.
_headers
=
{
"
Authorization
"
:
"
Basic
"
+
btoa
(
spec
.
login
+
"
:
"
+
spec
.
password
)};
this
.
_withCredentials
=
false
;
}
}
function
convertJSONToGet
(
json
)
{
...
...
@@ -4443,8 +4452,9 @@ return new Parser;
url
:
site_hal
.
_actions
.
add
.
href
,
data
:
form_data
,
xhrFields
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
})
.
push
(
function
(
evt
)
{
...
...
@@ -4558,6 +4568,7 @@ return new Parser;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
var
start
,
k
,
end
,
range
,
request_options
=
{
...
...
@@ -4565,7 +4576,7 @@ return new Parser;
"
dataType
"
:
"
blob
"
,
"
url
"
:
action
,
"
xhrFields
"
:
{
withCredentials
:
t
rue
withCredentials
:
t
his
.
_withCredentials
}
};
if
(
options
.
start
!==
undefined
||
options
.
end
!==
undefined
)
{
...
...
@@ -4587,6 +4598,11 @@ return new Parser;
range
=
"
bytes=
"
+
start
+
"
-
"
+
end
;
}
request_options
.
headers
=
{
Range
:
range
};
for
(
k
in
this
.
_headers
)
{
if
(
this
.
_headers
.
hasOwnProperty
(
k
))
{
request_options
.
headers
[
k
]
=
this
.
_headers
[
k
];
}
}
}
return
jIO
.
util
.
ajax
(
request_options
);
})
...
...
@@ -4646,8 +4662,9 @@ return new Parser;
"
data
"
:
data
,
"
dataType
"
:
"
blob
"
,
"
xhrFields
"
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
});
};
...
...
@@ -4764,8 +4781,9 @@ return new Parser;
local_roles
:
local_roles
}),
"
xhrFields
"
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
})
.
push
(
function
(
response
)
{
...
...
src/jio.storage/erp5storage.js
View file @
976ca8a4
...
...
@@ -11,7 +11,7 @@
/*jslint nomen: true, unparam: true */
/*global jIO, UriTemplate, FormData, RSVP, URI, Blob,
SimpleQuery, ComplexQuery*/
SimpleQuery, ComplexQuery
, btoa
*/
(
function
(
jIO
,
UriTemplate
,
FormData
,
RSVP
,
URI
,
Blob
,
SimpleQuery
,
ComplexQuery
)
{
...
...
@@ -24,8 +24,9 @@
"
type
"
:
"
GET
"
,
"
url
"
:
storage
.
_url
,
"
xhrFields
"
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
})
.
push
(
function
(
event
)
{
...
...
@@ -50,8 +51,9 @@
view
:
options
.
_view
}),
"
xhrFields
"
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
})
.
push
(
undefined
,
function
(
error
)
{
...
...
@@ -149,6 +151,13 @@
}
this
.
_url
=
spec
.
url
;
this
.
_default_view_reference
=
spec
.
default_view_reference
;
this
.
_headers
=
{};
this
.
_withCredentials
=
true
;
if
(
spec
.
login
!==
undefined
&&
spec
.
password
!==
undefined
)
{
this
.
_headers
=
{
"
Authorization
"
:
"
Basic
"
+
btoa
(
spec
.
login
+
"
:
"
+
spec
.
password
)};
this
.
_withCredentials
=
false
;
}
}
function
convertJSONToGet
(
json
)
{
...
...
@@ -186,8 +195,9 @@
url
:
site_hal
.
_actions
.
add
.
href
,
data
:
form_data
,
xhrFields
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
})
.
push
(
function
(
evt
)
{
...
...
@@ -301,6 +311,7 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
var
start
,
k
,
end
,
range
,
request_options
=
{
...
...
@@ -308,7 +319,7 @@
"
dataType
"
:
"
blob
"
,
"
url
"
:
action
,
"
xhrFields
"
:
{
withCredentials
:
t
rue
withCredentials
:
t
his
.
_withCredentials
}
};
if
(
options
.
start
!==
undefined
||
options
.
end
!==
undefined
)
{
...
...
@@ -330,6 +341,11 @@
range
=
"
bytes=
"
+
start
+
"
-
"
+
end
;
}
request_options
.
headers
=
{
Range
:
range
};
for
(
k
in
this
.
_headers
)
{
if
(
this
.
_headers
.
hasOwnProperty
(
k
))
{
request_options
.
headers
[
k
]
=
this
.
_headers
[
k
];
}
}
}
return
jIO
.
util
.
ajax
(
request_options
);
})
...
...
@@ -389,8 +405,9 @@
"
data
"
:
data
,
"
dataType
"
:
"
blob
"
,
"
xhrFields
"
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
});
};
...
...
@@ -507,8 +524,9 @@
local_roles
:
local_roles
}),
"
xhrFields
"
:
{
withCredentials
:
true
}
withCredentials
:
this
.
_withCredentials
},
"
headers
"
:
this
.
_headers
});
})
.
push
(
function
(
response
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment