8000 Create SPI and Provider for Verifiable Credentials Signing #25937 by wistefan · Pull Request #26263 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Create SPI and Provider for Verifiable Credentials Signing #25937 - #26263

Merged
mposolda merged 13 commits into
keycloak:mainfrom
wistefan:25937-create-spi-and-provider-for-verifiable-credentials-signing
Jan 25, 2024
Merged

mposolda merged 13 commits into
keycloak:mainfrom
wistefan:25937-create-spi-and-provider-for-verifiable-credentials-signing

Conversation

@wistefan
@wistefan wistefan commented Jan 17, 2024 •
Copy link
Copy Markdown
Contributor

The PR adds implementations for SPI and Provider factories and interfaces to prepare the implementation of the #25936 feature.

Closes #25937

@jonkoops @mposolda Sorry for creating such a mess on #25947 , this one should now only include the relevant changes.

@wistefan
wistefan requested a review from a team as a code owner January 17, 2024 11:32
@mposolda mposolda self-assigned this Jan 17, 2024
@jonkoops
Copy link
Copy Markdown
Contributor

No worries, I just closed it as it's kinda hard to reset the review policy, so creating a new PR just works around that.

@mposolda
Copy link
Copy Markdown
Contributor

@wistefan Thanks for the PR.

It looks OK, but I am pretty sure that you will have some test failures. As you can see in the https://github.com/keycloak/keycloak/actions/runs/7555072770/job/20572008260 , there is failure in ProfileTest and also failure in quarkus tests, which require to update in the "help" files. This change is needed always when new feature is added. For example see this commit for the inspiration 7da52a43 .

@tnorimat
Copy link
Copy Markdown
Contributor

@mposolda @thomasdarimont @jonkoops Hello, I will also review the PR but maybe in the next week (22 Jan-).

@wistefan
wistefan requested a review from a team as a code owner January 18, 2024 07:21
@ghost ghost added the team/cloud-native label Jan 18, 2024
@wistefan
wistefan force-pushed the 25937-create-spi-and-provider-for-verifiable-credentials-signing branch from 74650a2 to 4b93d31 Compare January 18, 2024 08:23
@mposolda
Copy link
Copy Markdown
Contributor

@wistefan Thanks! LGTM as long as tests are ok
@tnorimat Thanks Takashi. I will merge this once this PR is reviewed and approved from you

@wistefan
wistefan requested a review from a team as a code owner January 18, 2024 12:00
@ghost ghost added the team/ui label Jan 18, 2024
@wistefan
wistefan force-pushed the 25937-create-spi-and-provider-for-verifiable-credentials-signing branch 2 times, most recently from 6e0f5ee to f369a68 Compare January 18, 2024 12:03
@jonkoops jonkoops left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure why the UI team was requested as a reviewer, doesn't look like anything was touched in our domain.

@tnorimat tnorimat left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@wistefan Thank you for your PR! I added minor review comments. Could you check them?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a question: how this CLOCK is used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Clock is handed to the concrete signing services, they will need access to time. I could remove them if you prefer and readd once the concrete signing services are added.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the clarification.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed a36c099

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you. I confirmed the revised codes.

@thomasdarimont thomasdarimont Jan 22, 2024 •
Copy link
Copy Markdown
Contributor

Choose a reason f 10000 or hiding this comment

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

Small suggestion: Keycloak uses org.keycloak.common.util.Time for accessing the clock, which also allows to provide a global offset (for tests). However org.keycloak.common.util.Time uses System time and not necessarily UTC, so using Clock.systemUTC() directly might be fine, too. I wonder if it would make sense to have a Time.currentTimeUTC() method that also supports the offset.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi, thanks for mentioning that. Is there also a mechanism to mock time with that class?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, +1 for adding something like Time.currentTimeUTC() (if using UTC is really needed). We want only one utility for handling "time" in Keycloak, not multiple different utilities :-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 77de4e1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AFAIK, I did not see the use of "var" in Keycloak codebase.
@mposolda using "var" is OK?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure... Probably using standard string is slightly better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8375fbe

@tnorimat
tnorimat commented Jan 19, 2024 •
Copy link
Copy Markdown
Contributor

@wistefan Basically LGTM. I would be happy if you check my review comments and resolve the conflicts.
@mposolda I approve the PR. Could you merge it after resolving the PR's conflicts? Also could you check the review comment that I ask for your opinion?

@wistefan
wistefan force-pushed the 25937-create-spi-and-provider-for-verifiable-credentials-signing branch 5 times, most recently from a36c099 to 95f1546 Compare January 24, 2024 07:20
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it possible to make the feature EXPERIMENTAL instead of PREVIEW ? For the inspiration, you can take a look at this PR, which introduces some experimental feature what are all the various things needed to make tests working #26389 .

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
remove wildcard imports

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
@wistefan
wistefan force-pushed the 25937-create-spi-and-provider-for-verifiable-credentials-signing branch from bb67c4d to 3219b68 Compare January 24, 2024 12:36
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
@mposolda
mposolda merged commit efa6ddc into keycloak:main Jan 25, 2024
@mposolda
Copy link
Copy Markdown
Contributor

@wistefan @tnorimat @thomasdarimont Thanks everyone for the review and participation on this PR!

ShefeeqPM pushed a commit to ShefeeqPM/keycloak that referenced this pull request Jan 27, 2024
…5937 (keycloak#26263)

* implement oid4vci service interfaces

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>

* add oid4vc to the disabled features test

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>

* fix test and add doc

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>

* add the new preview feature

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>

* add class-level doc

remove wildcard imports

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>

* add license headers

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>

* fix year

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>

* fix teste

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>

* two additional test fixes

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>

* make the feature experimental

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>

* remove clock

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>

* remove usage of var

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>

* fix tests

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>

---------

Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Signed-off-by: ShefeeqPM <86718986+ShefeeqPM@users.noreply.github.com>
@wistefan
wistefan deleted the 25937-create-spi-and-provider-for-verifiable-credentials-signing branch January 31, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create SPI and Provider for Verifiable Credentials Signing

5 participants

0