Skip to content

TME info provider: migrate to APi verion 2#1447

Open
carmisergio wants to merge 7 commits into
Part-DB:masterfrom
carmisergio:tme-api-v2
Open

TME info provider: migrate to APi verion 2#1447
carmisergio wants to merge 7 commits into
Part-DB:masterfrom
carmisergio:tme-api-v2

Conversation

@carmisergio

Copy link
Copy Markdown

Problem

As per the API documentation, the v1 (Legacy) API will only be maintained until June 30, 2027. In addition, API tokens generated after May 14, 2026 can only be used with API v2, rendering it impossible for new users of Part-DB to access the TME info provider.


Solution

Update the relevant TMEProvider implementation to make use of the new API. The structure of the new version is not very different from the legacy one, so no huge changes are necessary.
The only significant change is in how authentication is handled: the new API requires a specific call to the /auth/token endpoint, which returns a session token to be used for subsequent queries. The info_provider.cache is used to store the session token. The TMEClient transparently handles requesting and renewing the session token.

Footprints

I have noticed that when both Case - mm and Case -inch (respectively IDs 2931 and 2932) are present in the parameter list, no Case (ID 35) is provided. In this situation, by default the provider uses the inch version to populate the footprint field, and I have added a new setting option to prefer the metric version instead.


Testing

Added new tests for TMEClient to verify the new authentication logic.
Modified TMEProvider tests to reflect new API version.
All tests pass locally.

@carmisergio

Copy link
Copy Markdown
Author

Translation file was messed up, sorry about that. Should all be fixed now.

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.

1 participant