Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Cache api sessions for router/tunneler. Fixes #1364 #1365

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

plorenz
Copy link
Member

@plorenz plorenz commented Mar 23, 2023

@plorenz plorenz requested a review from a team as a code owner March 23, 2023 03:11
@plorenz plorenz changed the base branch from main to idempotent-sessions March 23, 2023 03:11
@plorenz plorenz changed the base branch from idempotent-sessions to rate-limit-hosting March 23, 2023 03:11
@plorenz plorenz changed the title cache rt api sessions Cache api sessions for router/tunneler. Fixes #1364 Mar 23, 2023
if entityBucket == nil {
return boltz.NewNotFoundError(self.GetStore().GetEntityType(), "id", entityId)
}
annotationsBucket := entityBucket.GetOrCreatePath(annotationsBucketName)
Copy link
Member

@andrewpmartinez andrewpmartinez Mar 23, 2023

Choose a reason for hiding this comment

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

So there is a reserved bucket named annotations on every entity that stores a string to string kvs?

And this is currently only used to store API Session IDs for router/tunnelers to store their own, hopefully singular, API Session ID?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. I started off making it more general, allowing arbitrary sets and gets, but that complicated the API. I was thinking if we ever need support for other types, we can add it then. Also when the great session refactor happens we may want to drop the API again.

I could also put the API just on the session store, but I don't think someone is going to accidentally use it, so I wasn't too worried about it.

Base automatically changed from rate-limit-hosting to main March 23, 2023 14:21
@plorenz plorenz merged commit 6e90706 into main Mar 23, 2023
@plorenz plorenz deleted the cache-rt-api-sessions branch March 23, 2023 16:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache api-sessions for tunneler router so we don't need to unnecessarily create new sessions
2 participants