Skip to content

fix(client): allow token responses without refresh_token in non-interactive client credentials mode - #48

Open
embesozzi wants to merge 2 commits into
ferriskey:mainfrom
embesozzi:main
Open

embesozzi wants to merge 2 commits into
ferriskey:mainfrom
embesozzi:main

Conversation

@embesozzi

Copy link
Copy Markdown

Problem

Client-credentials authentication mode non-interactive, as documented in CLI → Authentication, fails on every command:

ferris-ctl context add ci \
  --url http://localhost:3333 \
  --client-id automation \
  --client-secret "xxxxx" \
  --realm master

ferris-ctl realm list
# error: http error: error decoding response body

FerrisKey correctly returns no refresh_token for the client_credentials grant.

Fix

#[serde(default)] on JwtToken.refresh_token, so a missing value becomes an empty string. The client-credentials path only uses access_token; the device-code login still receives and stores a real refresh token.

Testing

Ran the same commands shown in Problem with a confidential service-account client in master. ferris-ctl realm list now lists the realms instead of failing.

ferris-ctl realm list                                                                                              
NAME    ID                                  
master  xxxx

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1258e38c-6e44-4694-bef3-39240df5573b
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@NathaelB

Copy link
Copy Markdown
Member

Thanks, the diagnosis is right and the fix unblocks client_credentials. Two things:

  1. DCO check is failing, could you amend and force-push ?
  2. Optional: a small test deserializing a. token response without refresh_token would be nice.

…active client credentials mode

Signed-off-by: Martin Besozzi <embesozzi@gmail.com>
Signed-off-by: Martin Besozzi <embesozzi@gmail.com>
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.

2 participants