67 update poll transaction function#68
Merged
lukasmatusiewicz merged 9 commits intomasterfrom Nov 26, 2024
Merged
Conversation
nilsbehlen
approved these changes
Nov 26, 2024
| String response = runRequestAsync(ENDPOINT_POLLTRANSACTION, params, Collections.emptyMap(), false, GET); | ||
| PIResponse piresponse = this.parser.parsePIResponse(response); | ||
| return piresponse.value; | ||
| if (piresponse.challengeStatus == ChallengeStatus.pending) |
Member
There was a problem hiding this comment.
piresponse.challengestatus is of type challengestatus so why not just return that instead of all these if else
| " \"versionnumber\": \"3.2.1\",\n" + | ||
| " \"signature\": \"rsa_sha256_pss:\"\n" + "}") | ||
| .withBody("{\n\" id\": 1,\n\" jsonrpc\": \"2.0\",\n" + challengeStatusParameter + | ||
| " \"result\": {\n \"status\": true\n },\n \"time\": 1589446811.1909237,\n \"version\": \"privacyIDEA 3.2.1\",\n" + |
| String challengeStatusParameter = ""; | ||
| if (challengeStatus == ChallengeStatus.accept) | ||
| { | ||
| challengeStatusParameter = " \"detail\": {\n \"challenge_status\": \"accept\"\n },\n"; |
nilsbehlen
reviewed
Nov 26, 2024
| response.otpLength = getInt(detail, OTPLEN); | ||
|
|
||
| String r = getString(detail, CHALLENGE_STATUS); | ||
| for (ChallengeStatus en : ChallengeStatus.values()) |
Member
There was a problem hiding this comment.
why call it en? could just be cs. also formatting, no whitespace after en
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new enumeration
ChallengeStatusto manage the poll transaction challenge status in theprivacyIDEAproject. The changes include updates across multiple files to integrate this new enum and modify the related logic accordingly.Key changes include:
New Enumeration
src/main/java/org/privacyidea/ChallengeStatus.java: Added a new enumChallengeStatuswith possible values:accept,declined,pending, andnone.Integration of
ChallengeStatussrc/main/java/org/privacyidea/JSONParser.java: Updated the parsing logic to setresponse.challengeStatusbased on the newChallengeStatusenum.src/main/java/org/privacyidea/PIConstants.java: Added a new constantCHALLENGE_STATUSto be used as a key for challenge status in JSON responses.src/main/java/org/privacyidea/PIResponse.java: Added a new fieldchallengeStatusof typeChallengeStatusinitialized toChallengeStatus.none.src/main/java/org/privacyidea/PrivacyIDEA.java: Modified thepollTransactionmethod to return aChallengeStatusinstead of a boolean, reflecting the new challenge status values.Test Updates
src/test/java/org/privacyidea/TestPollTransaction.java: Updated test cases to handle the newChallengeStatusvalues and modified thesetPollTransactionResponsemethod to useChallengeStatusinstead of boolean values. [1] [2]