Skip to content

67 update poll transaction function#68

Merged
lukasmatusiewicz merged 9 commits intomasterfrom
67-update-poll-transaction-function
Nov 26, 2024
Merged

67 update poll transaction function#68
lukasmatusiewicz merged 9 commits intomasterfrom
67-update-poll-transaction-function

Conversation

@lukasmatusiewicz
Copy link
Copy Markdown
Contributor

This pull request introduces a new enumeration ChallengeStatus to manage the poll transaction challenge status in the privacyIDEA project. The changes include updates across multiple files to integrate this new enum and modify the related logic accordingly.

Key changes include:

New Enumeration

Integration of ChallengeStatus

Test Updates

@lukasmatusiewicz lukasmatusiewicz linked an issue Nov 26, 2024 that may be closed by this pull request
String response = runRequestAsync(ENDPOINT_POLLTRANSACTION, params, Collections.emptyMap(), false, GET);
PIResponse piresponse = this.parser.parsePIResponse(response);
return piresponse.value;
if (piresponse.challengeStatus == ChallengeStatus.pending)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

piresponse.challengestatus is of type challengestatus so why not just return that instead of all these if else

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

" \"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" +
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove excess whitespaces

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String challengeStatusParameter = "";
if (challengeStatus == ChallengeStatus.accept)
{
challengeStatusParameter = " \"detail\": {\n \"challenge_status\": \"accept\"\n },\n";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove excess whitespaces

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nilsbehlen nilsbehlen self-requested a review November 26, 2024 12:08
response.otpLength = getInt(detail, OTPLEN);

String r = getString(detail, CHALLENGE_STATUS);
for (ChallengeStatus en : ChallengeStatus.values())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why call it en? could just be cs. also formatting, no whitespace after en

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukasmatusiewicz lukasmatusiewicz merged commit 28488a5 into master Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update poll transaction function

2 participants