-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: finish zkp presentation flow scenario
- Loading branch information
1 parent
523cb36
commit 5a38513
Showing
9 changed files
with
120 additions
and
16 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
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
6 changes: 0 additions & 6 deletions
6
tests/end-to-end/src/test/kotlin/io/iohk/atala/prism/utils/Keys.kt
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
tests/end-to-end/src/test/kotlin/io/iohk/atala/prism/utils/Utils.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,35 @@ | ||
package io.iohk.atala.prism.utils | ||
|
||
import java.security.SecureRandom | ||
|
||
object Utils { | ||
/** | ||
static generateNonce(length: number): string { | ||
let result = "" | ||
while (result.length < length) { | ||
const byte = crypto.randomBytes(1)[0] | ||
if (byte >= 250) { | ||
continue | ||
} | ||
const randomDigit = byte % 10 | ||
result += randomDigit.toString() | ||
} | ||
return result | ||
} | ||
*/ | ||
fun generateNonce(length: Int): String { | ||
var result = "" | ||
val secureRandom = SecureRandom() | ||
while (result.length < length) { | ||
val byte = ByteArray(1) | ||
secureRandom.nextBytes(byte) | ||
val int = byte[0].toInt() and 0xFF | ||
if (int > 250) { | ||
continue | ||
} | ||
val digit = int % 10 | ||
result += digit | ||
} | ||
return result | ||
} | ||
} |
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
6 changes: 3 additions & 3 deletions
6
tests/end-to-end/src/test/resources/features/present-proof/AnoncredPresentProof.feature
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
3 changes: 2 additions & 1 deletion
3
tests/end-to-end/src/test/resources/features/present-proof/PresentProof.feature
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
@proof @jwt | ||
Feature: Respond to request proof | ||
The Edge Agent should be able to respond to a proof-of-request | ||
|
||
Scenario: Respond to request proof | ||
Given Cloud Agent is connected to Edge Agent | ||
And Edge Agent has 1 credentials issued by Cloud Agent | ||
And Edge Agent has '1' credentials issued by Cloud Agent | ||
When Cloud Agent asks for present-proof | ||
And Edge Agent sends the present-proof | ||
Then Cloud Agent should see the present-proof is verified |