Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Missing Verification for Automatic OIDC Access Token Refreshing and JWT Expiration Claim Parsing

Geschlossen
#486 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@aniket866 arbeitet bereits daran.

Seit 29.6.2026.

  • #487 von @aniket866 — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
72/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
go

Rechercherichtung

Beginne in pkg/connectors/microcks_client.go bei refreshAuthToken und untersuche, wie der Ablauf von JWT abläuft und wie Refresh-Anfragen gestellt werden. Verwende einen httptest-Mock-Keycloak-Server, um Fälle für noch gültige, bald ablaufende, abgelaufene und abgelaufene Refresh-Tokens abzudecken. Als erledigt gilt die Aufgabe, wenn das erwartete Refresh-Verhalten verifiziert ist und die neuen Tokens in der lokalen Konfigurations-YAML gespeichert werden, wobei bei Bedarf eine erneute Anmeldung gemeldet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

stale
Describe the bug
  • Location: pkg/connectors/microcks_client.go -> refreshAuthToken

  • Detailed Description:
    When you run the CLI for a long time (like keeping it active in the background), the security token it got when you logged in will eventually expire. To prevent commands from failing, we have code that reads the cached security token, parses it to see when it expires, and automatically requests a new one from the server if it's running out of time.

    Currently, we have zero tests checking this check-and-refresh logic. If a bug is introduced here, the CLI will suddenly stop working after a while and throw unauthorized errors (like HTTP 401) out of nowhere. We need to make sure the token checks are accurate and that the refresh requests are triggered correctly.

  • Test Requirements:

    • Verify that a valid, fresh token does not trigger a refresh.
    • Verify that a token close to expiry or already expired triggers the refresh server call.
    • Check that the CLI successfully updates the local configuration file with the new token.
    • Make sure the CLI handles cases where the refresh token itself has expired and tells the user to log in again.
Simulation Diagram
sequenceDiagram
    autonumber
    actor Test as Test Runner
    participant MC as microcksClient
    participant mockKC as Mock Keycloak Server (httptest)

    Test->>MC: Trigger refreshAuthToken() with Expired JWT
    activate MC
    MC->>MC: Parse JWT Claims & Detect Expiration (exp <= now)
    Note over MC: Expiration detected. Initiating refresh flow...
    MC->>mockKC: POST /protocol/openid-connect/token (refresh_token grant)
    activate mockKC
    mockKC-->>MC: HTTP 200 OK (New Auth & Refresh Tokens)
    deactivate mockKC
    MC->>MC: Save new tokens to localconfig YAML file
    MC-->>Test: Success (Token Refreshed)
    deactivate MC

Vorherrschende Sprache
Go
Sterne
58
Forks
72
Ø Merge
1 T. 11 Std.
Gemergte PRs (30 T.)
27

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microcks/microcks-cli

Alle Issues in microcks/microcks-cli

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.