Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grdf_konnector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
grdf_konnector
Commits
10e11d4a
Commit
10e11d4a
authored
10 months ago
by
Bastien DUMONT
Browse files
Options
Downloads
Patches
Plain Diff
fix: missing startTransaction
parent
7d3f5571
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!43
Merge dev into master
Pipeline
#105014
passed
10 months ago
Stage: test
Stage: build
Stage: push-build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/core.js
+49
-48
49 additions, 48 deletions
src/core/core.js
with
49 additions
and
48 deletions
src/core/core.js
+
49
−
48
View file @
10e11d4a
...
@@ -87,58 +87,59 @@ async function createConsent({
...
@@ -87,58 +87,59 @@ async function createConsent({
boToken
,
boToken
,
boUrlGRDF
,
boUrlGRDF
,
})
{
})
{
const
transaction
=
Sentry
.
startTransaction
({
return
Sentry
.
startSpan
(
op
:
'
konnector
'
,
{
name
:
'
createConsent
'
,
name
:
'
createConsent
'
,
tags
:
{
pce
},
},
})
async
span
=>
{
const
startDateString
=
moment
(
startDate
).
format
(
'
YYYY-MM-DD
'
)
const
startDateString
=
moment
(
startDate
).
format
(
'
YYYY-MM-DD
'
)
const
endDateString
=
moment
(
endDate
).
format
(
'
YYYY-MM-DD
'
)
const
endDateString
=
moment
(
endDate
).
format
(
'
YYYY-MM-DD
'
)
// Handle some accounts running everyday with no consent (previous accounts from oauth)
// Handle some accounts running everyday with no consent (previous accounts from oauth)
if
(
!
lastname
)
{
if
(
!
lastname
)
{
log
(
'
error
'
,
'
No lastname provided, stopping consent creation
'
)
log
(
'
error
'
,
'
No lastname provided, stopping consent creation
'
)
throw
errors
.
USER_ACTION_NEEDED
throw
errors
.
USER_ACTION_NEEDED
}
}
const
{
ID
:
consentId
}
=
await
createBoConsent
({
const
{
ID
:
consentId
}
=
await
createBoConsent
({
boUrlGRDF
,
boUrlGRDF
,
boToken
,
boToken
,
pce
,
pce
,
firstname
,
firstname
,
lastname
,
lastname
,
postalCode
,
postalCode
,
endDate
,
endDate
,
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
log
(
'
error
'
,
`Failed to create BO consent,
${
err
}
`
)
log
(
'
error
'
,
`Failed to create BO consent,
${
err
}
`
)
throw
errors
.
MAINTENANCE
throw
errors
.
MAINTENANCE
})
})
// Save BO consentId into account
// Save BO consentId into account
const
accountData
=
await
getAccount
(
ACCOUNT_ID
)
const
accountData
=
await
getAccount
(
ACCOUNT_ID
)
await
saveAccountData
(
ACCOUNT_ID
,
{
await
saveAccountData
(
ACCOUNT_ID
,
{
...
accountData
.
data
,
...
accountData
.
data
,
consentId
:
consentId
,
consentId
:
consentId
,
})
})
await
createGRDFConsent
({
await
createGRDFConsent
({
bearerToken
,
bearerToken
,
email
,
email
,
lastname
,
lastname
,
pce
,
pce
,
postalCode
,
postalCode
,
startDate
:
startDateString
,
startDate
:
startDateString
,
endDate
:
endDateString
,
endDate
:
endDateString
,
}).
catch
(
async
err
=>
{
}).
catch
(
async
err
=>
{
await
deleteBoConsent
({
await
deleteBoConsent
({
boUrlGRDF
,
boUrlGRDF
,
boToken
,
boToken
,
consentId
:
consentId
,
consentId
:
consentId
,
})
})
throw
err
throw
err
})
})
transaction
.
finish
()
throw
errors
.
CHALLENGE_ASKED
throw
errors
.
CHALLENGE_ASKED
}
)
}
}
module
.
exports
=
{
handleConsents
,
createConsent
}
module
.
exports
=
{
handleConsents
,
createConsent
}
This diff is collapsed.
Click to expand it.
Bastien DUMONT
@bdumont
mentioned in issue
ecolyo#656 (closed)
·
10 months ago
mentioned in issue
ecolyo#656 (closed)
mentioned in issue ecolyo#656
Toggle commit list
Ghost User
@ghost
mentioned in commit
d119f9f7
·
10 months ago
mentioned in commit
d119f9f7
mentioned in commit d119f9f7ca289007399a9d991ee465a6f5fc8ac7
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment