feat(Docuware): refs #8066 add username and password
gitea/salix/pipeline/pr-master There was a failure building this commit
Details
gitea/salix/pipeline/pr-master There was a failure building this commit
Details
This commit is contained in:
parent
952f8f3dfc
commit
9695fea48f
|
@ -9,15 +9,16 @@ module.exports = Self => {
|
|||
*/
|
||||
Self.getOptions = async() => {
|
||||
const {url, username, password} = await Self.app.models.DocuwareConfig.findOne();
|
||||
const {IdentityServiceUrl} = await axios.get(`${url}/Home/IdentityServiceInfo`);
|
||||
const {token_endpoint} = await axios.get(`${IdentityServiceUrl}/.well-known/openid-configuration`);
|
||||
const {access_token} = await axios.post(token_endpoint, {
|
||||
const {data: {IdentityServiceUrl}} = await axios.get(`${url}/Home/IdentityServiceInfo`);
|
||||
const {data: {token_endpoint}} = await axios.get(`${IdentityServiceUrl}/.well-known/openid-configuration`);
|
||||
const data = await axios.post(token_endpoint, JSON.stringify({
|
||||
grant_type: 'password',
|
||||
scope: 'docuware.platform',
|
||||
client_id: 'docuware.platform.net.client',
|
||||
username, // falta añadirlos
|
||||
password // falta añadirlos
|
||||
});
|
||||
username,
|
||||
password
|
||||
}));
|
||||
console.log('data: ', data);
|
||||
|
||||
const headers = {
|
||||
headers: {
|
||||
|
@ -42,8 +43,8 @@ module.exports = Self => {
|
|||
* @return {number} - The fileCabinet id
|
||||
*/
|
||||
Self.getDialog = async(code, action, fileCabinetId) => {
|
||||
if (!process.env.NODE_ENV)
|
||||
return Math.floor(Math.random() + 100);
|
||||
// if (!process.env.NODE_ENV)
|
||||
// return Math.floor(Math.random() + 100);
|
||||
|
||||
const docuwareInfo = await Self.app.models.Docuware.findOne({
|
||||
where: {
|
||||
|
@ -69,8 +70,8 @@ module.exports = Self => {
|
|||
* @return {number} - The fileCabinet id
|
||||
*/
|
||||
Self.getFileCabinet = async code => {
|
||||
if (!process.env.NODE_ENV)
|
||||
return Math.floor(Math.random() + 100);
|
||||
// if (!process.env.NODE_ENV)
|
||||
// return Math.floor(Math.random() + 100);
|
||||
|
||||
const options = await Self.getOptions();
|
||||
const docuwareInfo = await Self.app.models.Docuware.findOne({
|
||||
|
@ -95,7 +96,7 @@ module.exports = Self => {
|
|||
* @return {object} - The data
|
||||
*/
|
||||
Self.get = async(code, filter, parse) => {
|
||||
if (!process.env.NODE_ENV) return;
|
||||
// if (!process.env.NODE_ENV) return;
|
||||
|
||||
const options = await Self.getOptions();
|
||||
const fileCabinetId = await Self.getFileCabinet(code);
|
||||
|
@ -118,7 +119,7 @@ module.exports = Self => {
|
|||
* @return {object} - The data
|
||||
*/
|
||||
Self.getById = async(code, id, parse) => {
|
||||
if (!process.env.NODE_ENV) return;
|
||||
// if (!process.env.NODE_ENV) return;
|
||||
|
||||
const docuwareInfo = await Self.app.models.Docuware.findOne({
|
||||
fields: ['findById'],
|
||||
|
|
|
@ -18,15 +18,12 @@
|
|||
},
|
||||
"cookie": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"property": "*",
|
||||
"accessType": "*",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE vn.docuwareConfig ADD IF NOT EXISTS username varchar(100) NULL;
|
||||
ALTER TABLE vn.docuwareConfig ADD IF NOT EXISTS password varchar(100) NULL;
|
Loading…
Reference in New Issue