Skip to content

Support Dapr API token in workflow client #900

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

Closed
wants to merge 87 commits into from

Conversation

skyao
Copy link
Member

@skyao skyao commented Sep 6, 2023

Description

This PR is to support dapr api token in workflow client.

This PR is based on the code of PR #880 , so don't merge this PR until PR #880 is merged.

To save the time for code review, I list my changes on PR 880 here. Only 3 files changed:

  1. sdk/src/main/java/io/dapr/client/Headers.java

    Just make it to be "public" to be reused in workflow subproject.

  2. sdk/src/main/java/io/dapr/utils/NetworkUtils.java

    Add a optional parameter in method buildGrpcManagedChannel() to accept client grpc interceptor

    public static ManagedChannel buildGrpcManagedChannel(ClientInterceptor... interceptors) {
    
    if (interceptors == null) {
      builder = builder.intercept(interceptors);
      }
    }
  3. sdk-workflows/src/main/java/io/dapr/workflows/client/DaprWorkflowClient.java

    Define WORKFLOW_INTERCEPTOR and pass it to buildGrpcManagedChannel() method.

      public DaprWorkflowClient() {
       this(NetworkUtils.buildGrpcManagedChannel(WORKFLOW_INTERCEPTOR));
     }  

Issue reference

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

LionTao and others added 30 commits June 21, 2023 12:34
Signed-off-by: LionTao <taojiachun980831@163.com>

Signed-off-by: LionTao <taojiachun980831@163.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](codecov/codecov-action@v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
* Bump from spring boot 2.3.5.RELEASE to 2.7.8

Signed-off-by: Sergio <champel@gmail.com>
(cherry picked from commit 9152c91)

* Ensure old versions of spring boot are still compatible

Signed-off-by: Sergio <champel@gmail.com>

---------

Signed-off-by: champel <champel@gmail.com>
Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
* Bump from reactor 2.3.5.RELEASE to 2.7.8

Signed-off-by: Sergio <champel@gmail.com>

* Simplification

Signed-off-by: Sergio <champel@gmail.com>

---------

Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
* add grpc subscriber

Signed-off-by: MregXN <mregxn@gmail.com>

* modify README.md

Signed-off-by: MregXN <mregxn@gmail.com>

* modify README.md in examples

Signed-off-by: MregXN <mregxn@gmail.com>

* Modify DaprApplication to support examples where protocol is not specified.

Signed-off-by: MregXN <mregxn@gmail.com>

* modify formatter to pass checkstyle

Signed-off-by: MregXN <mregxn@gmail.com>

* Update springboot to latest minor.patch version. (dapr#826)

Signed-off-by: MregXN <mregxn@gmail.com>

* Use runtime 1.10.0-rc.X and CLI 1.10.0-rc.X (dapr#827)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Upgrade the version to 1.9.0-SNAPSHOT (dapr#829)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Generate updated javadocs for 1.8.0 (dapr#836)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Update Dapr runtime and CLI to 1.10. (dapr#837)

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Inject autoconfiguration in the Spring Boot 3 style (dapr#831)

* Bump from spring boot 2.3.5.RELEASE to 2.7.8

Signed-off-by: Sergio <champel@gmail.com>
(cherry picked from commit 9152c91)

* Ensure old versions of spring boot are still compatible

Signed-off-by: Sergio <champel@gmail.com>

---------

Signed-off-by: champel <champel@gmail.com>
Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* Bump from reactor 2.3.5.RELEASE to 2.7.8 (dapr#830)

* Bump from reactor 2.3.5.RELEASE to 2.7.8

Signed-off-by: Sergio <champel@gmail.com>

* Simplification

Signed-off-by: Sergio <champel@gmail.com>

---------

Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: MregXN <mregxn@gmail.com>

* rerun checks

Signed-off-by: MregXN <mregxn@gmail.com>

* modify the way of grpc server starts

Signed-off-by: MregXN <mregxn@gmail.com>

* modify README

Signed-off-by: MregXN <mregxn@gmail.com>

* Update pom.xml

Signed-off-by: MregXN <46479059+MregXN@users.noreply.github.com>

---------

Signed-off-by: MregXN <mregxn@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: champel <champel@gmail.com>
Signed-off-by: Sergio <champel@gmail.com>
Signed-off-by: MregXN <46479059+MregXN@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: champel <champel@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.1 to 3.1.4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v3.1.1...v3.1.4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
* prepare before testing

* Update tests

* fix checkstyle

---------

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Bill DeRusha <billderusha@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Hannah Kennedy <hakenned@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Hannah Kennedy <hakenned@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Bill DeRusha <444835+bderusha@users.noreply.github.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
* addiny getInstanceMetadata, waitForInstanceStart and waitForInstanceCompletion implementation
---------

Co-authored-by: aymanmahmoud_microsoft <aymanmahmoud@microsoft.com>
Signed-off-by: Aymand Mahmoud <aymanmahmoud@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Co-authored-by: Julio Rezende <jsilvarezend@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Julio Rezende <jsilvarezend@microsoft.com>
Co-authored-by: Julio Rezende <jsilvarezend@microsoft.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Julio Rezende <jsilvarezend@microsoft.com>
macromania and others added 15 commits August 25, 2023 17:07
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
Signed-off-by: Mahmut Canga <cangamahmut@gmail.com>
@skyao skyao requested review from a team as code owners September 6, 2023 09:56
@skyao
Copy link
Member Author

skyao commented Sep 13, 2023

Updated this PR because PR #880 is merged, now we can start the review of this PR.

@artursouza @mukundansundar

Copy link
Contributor

@mukundansundar mukundansundar left a comment

Choose a reason for hiding this comment

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

@skyao plesse fix dco sign-off

artursouza
artursouza previously approved these changes Sep 15, 2023
@codecov
Copy link

codecov bot commented Sep 17, 2023

Codecov Report

Patch coverage: 16.66% and project coverage change: -0.16% ⚠️

Comparison is base (0543011) 76.63% compared to head (c5c4524) 76.47%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #900      +/-   ##
============================================
- Coverage     76.63%   76.47%   -0.16%     
- Complexity     1397     1398       +1     
============================================
  Files           132      132              
  Lines          4254     4264      +10     
  Branches        495      497       +2     
============================================
+ Hits           3260     3261       +1     
- Misses          735      743       +8     
- Partials        259      260       +1     
Files Changed Coverage Δ
sdk/src/main/java/io/dapr/client/Headers.java 0.00% <0.00%> (ø)
sdk/src/main/java/io/dapr/utils/NetworkUtils.java 70.45% <0.00%> (-3.36%) ⬇️
...a/io/dapr/workflows/client/DaprWorkflowClient.java 70.00% <22.22%> (-10.96%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mukundansundar
Copy link
Contributor

closed by #916

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.