Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
n0900 committed Oct 7, 2024
1 parent c1f4f92 commit a6c3259
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Release 5.1.0:
- tbd
- New Class `SignatureRequestFrom` to handle signature requests by reference
- Rename `AuthenticationRequestParser` to `RequestParser`
- `RequestParser` can now handle `SignatureRequestFrom`

Release 5.0.0:
- Remove `OidcSiopWallet.newDefaultInstance()` and replace it with a constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import kotlinx.serialization.json.JsonObject
class RequestParser(
/**
* Need to implement if resources are defined by reference, i.e. the URL for a [JsonWebKeySet],
* or the authentication request itself as `request_uri`, or `presentation_definition_uri`.
* or the request itself as `request_uri`, or `presentation_definition_uri`.
* Implementations need to fetch the url passed in, and return either the body, if there is one,
* or the HTTP header `Location`, i.e. if the server sends the request object as a redirect.
*/
Expand All @@ -50,7 +50,7 @@ class RequestParser(
}

/**
* Pass in the URL sent by the Verifier (containing the [AuthenticationRequestParameters] as query parameters),
* Pass in the URL sent by the Verifier (containing the [RequestParameters] as query parameters),
* to create [AuthenticationResponseParameters] that can be sent back to the Verifier, see
* [AuthenticationResponseResult].
*/
Expand All @@ -68,7 +68,6 @@ class RequestParser(
SignatureRequestParametersFrom.Uri(it, result)
}
}
// }
}.onFailure { it.printStackTrace() }.getOrNull()
?: catching { // maybe it is already a JSON string
when (val params = jsonSerializer.decodeFromString(RequestParametersSerializer, input)) {
Expand All @@ -83,11 +82,10 @@ class RequestParser(
.also { Napier.w("Could not parse authentication request: $input") }

val extractedParams =
(parsedParams.parameters as? AuthenticationRequestParameters)?.let {
extractRequestObject(it)
} ?: parsedParams
.also { Napier.i("Parsed authentication request: $it") }
extractedParams
(parsedParams.parameters as? AuthenticationRequestParameters)?.let { extractRequestObject(it) }
?: parsedParams

extractedParams.also { Napier.i("Parsed authentication request: $it") }
}

private suspend fun extractRequestObject(params: AuthenticationRequestParameters): RequestParametersFrom? =
Expand Down

0 comments on commit a6c3259

Please sign in to comment.