Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store access token in trigger dao #7890

Merged
merged 6 commits into from
Nov 5, 2020
Merged

Store access token in trigger dao #7890

merged 6 commits into from
Nov 5, 2020

Conversation

aherrmann-da
Copy link
Contributor

  • stores the access token associated with a running trigger in the trigger dao database
  • simplifies readRunningTriggers using the Get and Put for Party and Identifier
  • extends the test suite to test all four trigger service configurations

Closes #7720 (refresh token is not implemented yet)

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

- non-authenticated with in-memory backend
- non-authenticated with database backend
- authenticated with in-memory backend
- authenticated with database backend

changelog_begin
changelog_end
@aherrmann-da aherrmann-da added the component/trigger-service Trigger service label Nov 4, 2020
@aherrmann-da aherrmann-da added this to the Trigger Service milestone Nov 4, 2020
Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

"""
insert.update.run.void
}

private def queryRunningTrigger(triggerInstance: UUID): ConnectionIO[Option[RunningTrigger]] = {
val select: Fragment = sql"""
select (trigger_instance, trigger_name, trigger_party) from running_triggers
select trigger_instance, full_trigger_name, trigger_party, access_token from running_triggers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m confused, how did this work before? The column name isn’t changed by this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't work before, this code was untested so far. See #7750 (comment).

aherrmann-da and others added 2 commits November 5, 2020 10:07
@mergify mergify bot merged commit 4f92ed1 into master Nov 5, 2020
@mergify mergify bot deleted the trigger-dao branch November 5, 2020 09:45
aherrmann-da pushed a commit that referenced this pull request Nov 5, 2020
Following the example of the corresponding ledger on SQL tests.

The digests had to be updated as both of them had gone out of sync.
The init digest presumably due to the change in #7226 and the one for
adding the access token during review of #7890.

changelog_begin
changelog_end
mergify bot pushed a commit that referenced this pull request Nov 6, 2020
* Check the trigger dao migrations digest

Following the example of the corresponding ledger on SQL tests.

The digests had to be updated as both of them had gone out of sync.
The init digest presumably due to the change in #7226 and the one for
adding the access token during review of #7890.

changelog_begin
changelog_end

* define abstract migrations test

* Use abstract migrations test in trigger service tests

* use abstract migrations test in ledger on SQL

* Retain check for number of .sql resources

* Factor out the hash-migrations script

* Consistent shell settings

Addressing review comment

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
garyverhaegen-da pushed a commit that referenced this pull request Nov 6, 2020
* Check the trigger dao migrations digest

Following the example of the corresponding ledger on SQL tests.

The digests had to be updated as both of them had gone out of sync.
The init digest presumably due to the change in #7226 and the one for
adding the access token during review of #7890.

changelog_begin
changelog_end

* define abstract migrations test

* Use abstract migrations test in trigger service tests

* use abstract migrations test in ledger on SQL

* Retain check for number of .sql resources

* Factor out the hash-migrations script

* Consistent shell settings

Addressing review comment

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Persist access & refresh token in trigger service
3 participants