Skip to content
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

support of imported keys with new format added #2473

Merged
merged 3 commits into from
Aug 30, 2019
Merged

Conversation

dencoded
Copy link
Contributor

added changes for https://github.com/TykTechnologies/product/issues/165

I required to modify tests a lot as now operation with key requires carefully set and matched orgID

@dencoded dencoded requested review from buger and asoorm August 27, 2019 19:55
@@ -281,7 +286,21 @@ func (b *DefaultSessionManager) SessionDetail(keyName string, hashed bool) (user
if hashed {
jsonKeyVal, err = b.store.GetRawKey(b.store.GetKeyPrefix() + keyName)
} else {
jsonKeyVal, err = b.store.GetKey(keyName)
// try to get legacy and new format key at once
Copy link
Member

@buger buger Aug 28, 2019

Choose a reason for hiding this comment

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

We can actually detect if key is "imported". Smt like:
If storage.TokenOrg(key) != orgID

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so we don't need to do MGET here?
There might be some false positives if imported key is base64 encoded JSON with org field.

Copy link
Member

Choose a reason for hiding this comment

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

Mget needed only for custom keys

@buger buger merged commit 4c1eb53 into master Aug 30, 2019
@buger buger deleted the create-custom-key branch August 30, 2019 08:03
furkansenharputlu pushed a commit that referenced this pull request Sep 16, 2019
added changes for https://github.com/TykTechnologies/product/issues/165

I required to modify tests a lot as now operation with key requires carefully set and matched orgID
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.

None yet

2 participants