-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented basic OpenID4VCI issuing server and beefed up existing Wa…
…llet Server to use it. In the process, also added "application support" interface to Wallet Server that performs Client Attestation and helps creating redirect urls to use with OpenID-style web-based authorization workflows. Also, a minor fix to flow-processor to allow nullable parameters and return values in flow RPC methods. Signed-off-by: Peter Sorotokin <[email protected]>
- Loading branch information
Showing
55 changed files
with
1,896 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
identity-issuance/src/main/java/com/android/identity/issuance/ApplicationSupport.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.android.identity.issuance | ||
|
||
import com.android.identity.flow.annotation.FlowInterface | ||
import com.android.identity.flow.annotation.FlowMethod | ||
import com.android.identity.flow.client.FlowNotifiable | ||
import com.android.identity.securearea.KeyAttestation | ||
|
||
/** | ||
* Server-side support functionality for the wallet mobile app. This is needed even if the | ||
* full-blown wallet server is not used. | ||
*/ | ||
@FlowInterface | ||
interface ApplicationSupport : FlowNotifiable<LandingUrlNotification> { | ||
/** | ||
* Creates a "landing" URL suitable for web redirects. When a landing URL is navigated to, | ||
* [LandingUrlNotification] is sent to the client. | ||
* | ||
* NB: this method returns the relative URL, server base URL should be prepended to it before | ||
* use. | ||
*/ | ||
@FlowMethod | ||
suspend fun createLandingUrl(): String | ||
|
||
/** | ||
* Returns the query portion of the URL which was actually used when navigating to a landing | ||
* URL, or null if navigation did not occur yet. | ||
* | ||
* [relativeUrl] relative URL of the landing page as returned by [createLandingUrl]. | ||
*/ | ||
@FlowMethod | ||
suspend fun getLandingUrlStatus(relativeUrl: String): String? | ||
|
||
/** | ||
* Creates OAuth JWT client assertion based on the mobile-platform-specific [KeyAttestation]. | ||
*/ | ||
@FlowMethod | ||
suspend fun createJwtClientAssertion( | ||
clientAttestation: KeyAttestation, | ||
targetIssuanceUrl: String | ||
): String | ||
} |
10 changes: 10 additions & 0 deletions
10
identity-issuance/src/main/java/com/android/identity/issuance/LandingUrlNotification.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.android.identity.issuance | ||
|
||
import com.android.identity.cbor.annotation.CborSerializable | ||
|
||
@CborSerializable | ||
class LandingUrlNotification( | ||
val baseUrl: String | ||
) { | ||
companion object | ||
} |
10 changes: 10 additions & 0 deletions
10
identity-issuance/src/main/java/com/android/identity/issuance/LandingUrlUnknownException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.android.identity.issuance | ||
|
||
import com.android.identity.cbor.annotation.CborSerializable | ||
import com.android.identity.flow.annotation.FlowException | ||
|
||
@FlowException | ||
@CborSerializable | ||
class LandingUrlUnknownException(message: String?) : Exception(message) { | ||
companion object | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
identity-issuance/src/main/java/com/android/identity/issuance/evidence/EvidenceRequestWeb.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.android.identity.issuance.evidence | ||
|
||
/** | ||
* Launch a browser using the given URL. | ||
*/ | ||
data class EvidenceRequestWeb( | ||
val url: String, | ||
val redirectUri: String, | ||
) : EvidenceRequest() |
6 changes: 6 additions & 0 deletions
6
...tity-issuance/src/main/java/com/android/identity/issuance/evidence/EvidenceResponseWeb.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.android.identity.issuance.evidence | ||
|
||
data class EvidenceResponseWeb( | ||
/** Portion of the URL used for redirecting (not including EvidenceRequestWeb.redirectUri) */ | ||
val response: String | ||
) : EvidenceResponse() |
Oops, something went wrong.