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

Extend RequestParsing to SignatureRequests #143

Merged
merged 14 commits into from
Oct 16, 2024

Conversation

n0900
Copy link
Contributor

@n0900 n0900 commented Oct 7, 2024

SignatureRequest can be passed by reference just like AuthenticationRequest.
Here we extend AuthenticationRequestParser to also handle requests by reference for signatures sent by the driving application/terminal service. For consistency we rename the class to RequestParser and introduce the SignatureRequestFrom data classes.

@n0900 n0900 requested a review from nodh October 7, 2024 11:58
@n0900 n0900 self-assigned this Oct 7, 2024
@n0900 n0900 force-pushed the feature/refactorRequestParser branch from 75c9ec4 to a6c3259 Compare October 7, 2024 16:12
@nodh
Copy link
Contributor

nodh commented Oct 8, 2024

It's hard to review this, since that other one #127 is still a draft...
But to me the SignatureRequestParameters look a lot like AuthenticationRequestParameters, so why split it up? Since the latter one still has numSignatures and other stuff in it?!

@n0900
Copy link
Contributor Author

n0900 commented Oct 9, 2024

It's hard to review this, since that other one #127 is still a draft...

Admittedly the draft became quite unwieldy but it is not yet at a point where merging makes sense so I planned on splitting new changes into seperate merge requests and the draft in the end is the full feature implementation. What do you think of this?

But to me the SignatureRequestParameters look a lot like AuthenticationRequestParameters, so why split it up? Since the latter one still has numSignatures and other stuff in it?!

Since they do not have a lot of fields in common I think it makes sense to keep the two seperate. We also talked about seperating some other classes at a previous time and I thought it would be good to not add more to these. So I introduced the interface RequestParameter

We could realistically combine AuthenticationRequestParameterFrom and SignatureRequestParameterFrom to simply be RequestparameterFrom however this has a long rat tail in OidcSiopWallet and beyond which was rather unpleasant to work with so I decided against it. It you want I could also implement a version like this.

@n0900 n0900 force-pushed the feature/refactorRequestParser branch from dac98f6 to 29cf053 Compare October 9, 2024 12:52
@n0900
Copy link
Contributor Author

n0900 commented Oct 9, 2024

But to me the SignatureRequestParameters look a lot like AuthenticationRequestParameters, so why split it up? Since the latter one still has numSignatures and other stuff in it?!

On second look I agree that they look related and I have moved the vals they have in common to the interface. However CSC actually extends AuthenticationRequestParameters as well and as such uses both in different contexts. This in turn means that combining them is very messy from a readability perspective.

@n0900
Copy link
Contributor Author

n0900 commented Oct 9, 2024

On a different note:
In AuthenticationRequestParameters it says that clientID is required, but it is nullable.
When making it not nullable tests fail.

@nodh
Copy link
Contributor

nodh commented Oct 10, 2024

But to me the SignatureRequestParameters look a lot like AuthenticationRequestParameters, so why split it up? Since the latter one still has numSignatures and other stuff in it?!

On second look I agree that they look related and I have moved the vals they have in common to the interface. However CSC actually extends AuthenticationRequestParameters as well and as such uses both in different contexts. This in turn means that combining them is very messy from a readability perspective.

Yeah, now I get it ... it is really not a good idea to combine them

@nodh
Copy link
Contributor

nodh commented Oct 10, 2024

It looks to me that the parsed SignatureRequestParametersFrom are never used anywhere?

@n0900 n0900 force-pushed the feature/refactorRequestParser branch from adce946 to a33f74b Compare October 14, 2024 10:05
@n0900 n0900 force-pushed the feature/refactorRequestParser branch from a33f74b to 01f693c Compare October 14, 2024 10:19
@n0900
Copy link
Contributor Author

n0900 commented Oct 14, 2024

It looks to me that the parsed SignatureRequestParametersFrom are never used anywhere?

This is true. It is only used as a container for SignatureRequestParameters in order to use RequestParser as originally written - the 'From' part is currently ignored. The class will be used when parsing requests which are sent by a driving application. Tests coming up

@n0900 n0900 requested a review from nodh October 14, 2024 13:08
@n0900 n0900 merged commit d1c106f into feature/signatureServices Oct 16, 2024
4 checks passed
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.

2 participants