Skip to content

Conversation

@fero1xd
Copy link
Contributor

@fero1xd fero1xd commented Dec 12, 2024

Closes #37

@changeset-bot
Copy link

changeset-bot bot commented Dec 12, 2024

⚠️ No Changeset found

Latest commit: dd38ee3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mwood23
Copy link

mwood23 commented Jan 3, 2025

Thank you for this! It's much needed because if you run stuff in a VPC then you have to deal with finding a way to get your auth server and dynamo to work. With Redis, it's no problem.

I think the contract has changed since you put in the PR. I needed to add this to make it work:

async set(key: string[], value: any, expiry?: Date) {
  // Calculate TTL in seconds if expiry date is provided
  const ttl = expiry
    ? Math.max(0, Math.floor((expiry.getTime() - Date.now()) / 1000))
    : undefined;

As for connecting (if you are using elasticache) make sure to set TLS to {} so you connect over the right protocol:

storage: RedisStorage({
  username: Resource.Redis.username,
  password: Resource.Redis.password,
  host: Resource.Redis.host,
  port: Resource.Redis.port,
  ...(IS_LOCAL ? {} : { tls: {} }),
}),

@raphaeltm
Copy link
Contributor

FYI, I've merged this into a fork with @mwood23's changes and tested it and it works nicely.

@fero1xd
Copy link
Contributor Author

fero1xd commented Mar 6, 2025

Yeah, I opened this PR a long time ago. Since then, I guess the API has been refactored. I've also been a bit busy with other things. It would be great if someone could open a new PR with these updated changes.

@barziahmed
Copy link

Does this support Upstash Redis? It uses its own client package, not node-redis

nullfunc pushed a commit to DefangLabs/openauth that referenced this pull request Sep 4, 2025
"@types/node": "22.10.1",
"arctic": "2.2.2",
"hono": "4.6.9",
"ioredis": "5.4.1",

Choose a reason for hiding this comment

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

this should prob be in "dependencies"

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.

feat: Redis storage support

6 participants