Skip to content

🎁 Add Api-Key auth for WillowSword #2229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2024

Conversation

kirkkwang
Copy link
Collaborator

@kirkkwang kirkkwang commented May 30, 2024

This commit will add the api_key column to the user model and turn on authorized requests for WillowSword. To give a user access, do something like the following:

u = User.find_by(email: 'some_user@example.com')
u.api_key = SecureRandom.uuid
u.save!

To add it in the header, it should look like this:

curl --request GET \
  --url http://dev.hyku.test/sword/service_document \
  --header 'Content-Type: application/xml' \
  --header 'Api-key: some-api-key'

Ref:

This commit will add the api_key column to the user model and turn on
authorized requests for WillowSword.  To give a user access, do
something like the following:

```rb
u = User.find_by(email: 'some_user@example.com')
u.api_key = SecureRandom.uuid
u.save!
```

Ref:
  - https://github.com/CottageLabs/willow_sword/wiki/Enabling-Authorization-In-Willow-Sword
  - notch8/palni-palci#1037
@kirkkwang kirkkwang force-pushed the add-api-key-to-user-for-willow-sword branch from 963f856 to aab8006 Compare May 30, 2024 21:07
@kirkkwang kirkkwang added the patch-ver for release notes label May 30, 2024
@kirkkwang kirkkwang merged commit 52bb04d into main May 30, 2024
4 of 5 checks passed
@kirkkwang kirkkwang deleted the add-api-key-to-user-for-willow-sword branch May 30, 2024 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch-ver for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants