-
Notifications
You must be signed in to change notification settings - Fork 4
DC API pre-phase #369
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
base: main
Are you sure you want to change the base?
DC API pre-phase #369
Conversation
ccc94ea
to
9efad0a
Compare
…ent to be executed as one step that validates and resolves the authorization request
… in wallet metadata set presentation_definition_uri_supported to false by default
…i-signed authorization requests.
9efad0a
to
c65edb5
Compare
Value of presentation_definition_uri_supported in wallet metadata will be set to false by default | ||
""", | ||
) | ||
val presentationDefinitionUriSupported: Boolean = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider removing it from the constructor.
Alternatively, keep the constructor argument but remove the val
...n/kotlin/eu/europa/ec/eudi/openid4vp/internal/request/DefaultAuthorizationRequestResolver.kt
Outdated
Show resolved
Hide resolved
...n/kotlin/eu/europa/ec/eudi/openid4vp/internal/request/DefaultAuthorizationRequestResolver.kt
Outdated
Show resolved
Hide resolved
...n/kotlin/eu/europa/ec/eudi/openid4vp/internal/request/DefaultAuthorizationRequestResolver.kt
Outdated
Show resolved
Hide resolved
...n/kotlin/eu/europa/ec/eudi/openid4vp/internal/request/DefaultAuthorizationRequestResolver.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a single change for your consideration.
Create a class representating JWS in Json and change the ReceivedRequest.Signed to contain it
…troduced JWSSigned data class for signed requests.
src/main/kotlin/eu/europa/ec/eudi/openid4vp/internal/RFC7515Spec.kt
Outdated
Show resolved
Hide resolved
…sSigned with sealed interface JwsJson with 2 members, General and Flattened.
src/main/kotlin/eu/europa/ec/eudi/openid4vp/internal/RFC7515Spec.kt
Outdated
Show resolved
Hide resolved
val signature: Base64UrlNoPadding, | ||
) | ||
|
||
@Serializable(with = Base64UrlNoPaddingSerializer::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider implementing Base64UrlNoPadding
as a value class have a value
attribute.
Perhaps
fun <T> decode( f: (ByteArray) ->T): T
can be addedfun decode(): ByteArray = decode { it }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base64UrlNoPadding
is already a data class with one value attribute. Do you mean to have this attribute be a ByteArray?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No i mean literally instead of data class to defined it as value class
...n/kotlin/eu/europa/ec/eudi/openid4vp/internal/request/DefaultAuthorizationRequestResolver.kt
Outdated
Show resolved
Hide resolved
SignedJWT.parse("${it.header.protected}.${jwsSigned.payload}.${it.signature}") | ||
internal fun ReceivedRequest.Signed.toSignedJwts(): List<SignedJWT> = when (jwsJson) { | ||
is JwsJson.Flattened -> listOf( | ||
SignedJWT.parse("${jwsJson.protected}.${jwsJson.payload}.${jwsJson.signature}"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nimbus provides a class that is in par withJwsJson.Flattened
named JWSObject
Consider JwsJson.Flattened
-> JWSObject
-> SignedJWT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest I don't see the benefit to go first to JWSObject and then to SignedJWT. JWSObject would have to be serialized to compact form and then call SignedJWT.parse() with no benefit doing that instead of calling directly SignedJWT.parse()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this.
@ThreadSafe
public class SignedJWT extends JWSObject implements JWT {
SignedJWT is a JWSObject
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True but what is the benefit converting JwsJson.Flattened to JWSObject and then to SignedJWT?
As a pre-phase before introducing DC API the following refactorings are perfomed as analyzed in #349
Unsinged
-> equivalent to currentPlain
data classSigned
-> is a new abstraction that merges the concerns of single-signed and multi-signed authorization request