WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@makinoshi
Copy link
Member

Add User API Token Authentication Support

This branch adds support for cybozu.com User API token authentication.
The User API token uses Bearer authentication in the Authorization header, which is different from the existing kintone app API token that uses the X-Cybozu-API-Token header.

Key Changes

Authentication Module (authentication.cljc):

  • Added user-api-token field to the Auth record
  • Updated the -header method to set Authorization: Bearer when user-api-token is provided
  • Enhanced new-auth function to accept :user-api-token parameter
  • Added validation to prevent simultaneous use of basic authentication and user API token (both use Authorization header)

Documentation Updates:

  • Updated README.md with usage examples for User API token authentication
  • Added note about mutual exclusivity between basic auth and user API token
  • Added changelog entry for the new feature

Testing:

  • Added test cases for User API token header generation
  • Added test case to verify assertion error when basic auth and user API token are used together

Usage

  ;; User API token authentication
  (auth/new-auth {:user-api-token "your-user-api-token"})

  ;; This will throw an AssertionError (not allowed)
  (auth/new-auth {:basic {:username "user" :password "pass"}
                  :user-api-token "token"})

This enhancement enables developers to authenticate with cybozu.com User APIs using the appropriate Bearer token authentication method while maintaining backward compatibility with existing authentication mechanisms.

@makinoshi makinoshi force-pushed the add-user-api-token-support branch from 9feb307 to c2621aa Compare August 21, 2025 06:30
@makinoshi makinoshi marked this pull request as ready for review August 21, 2025 06:32
@makinoshi makinoshi requested a review from egs33 August 21, 2025 06:32
@makinoshi makinoshi changed the title Add user api token support Add User API Token Authentication Support Aug 21, 2025
Copy link
Member

@egs33 egs33 left a comment

Choose a reason for hiding this comment

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

😄

@makinoshi makinoshi merged commit 1dfc3f8 into main Aug 21, 2025
3 checks passed
@makinoshi makinoshi deleted the add-user-api-token-support branch August 21, 2025 07:00
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.

3 participants