Tripletex / Tripletex/tripletex-api2

Example code for TripletexApiClient causes exceptions

Open
#73 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
49
Forks
47
Avg merge
1h 1m
Merged PRs (30d)
1

Description

The example code for automatically generating a session token should be updated (tripletex-api2/examples/java-gradle/token/src/main/java/no/tripletex/api/v2/TripletexApiClient.java)

ZonedDateTime error:

tokenValidUntil is stored as ZonedDateTime on line 39
session token is generated with date only at line 100
but the later validity checks still use the ZonedDateTime to check if the token is valid, which includes the time component of ZonedDateTime.
This will result in Unauthorized exceptions between midnight and the time of day in the tokenValidUntil field.

StackOverflowException:
buildCall ends up calling sessionApi.delete, which in turn calls buildCall, etc.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tripletex-api2/examples/java-gradle/token/src/main/java/no/tripletex/api/v2/TripletexApiClient.java, especially tokenValidUntil near line 39, token generation near line 100, and the validity checks. Trace buildCall and sessionApi.delete to confirm the recursive call path. Done means the example no longer produces the ZonedDateTime validity failure or StackOverflowException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.