-
Notifications
You must be signed in to change notification settings - Fork 395
enhance jwt caching #9481
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
base: master
Are you sure you want to change the base?
enhance jwt caching #9481
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started review and then stopped in the middle.
- Im not sure what is the goal of this pr? it removes "once" related stuff but doesn't offer any alternative
- capacity
LakectlDirName = ".lakectl" | ||
CacheDirName = "cache" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- What's the purpose of those directories? Why not just
~/.lakectl_token_cache.json
? Or just~/.lakectl/token_cache.json
(If you really need a dir) - This is not the right location for such things. It belongs to lakectl code parts, not here.
if baseDir == "" { | ||
var err error | ||
baseDir, err = os.UserHomeDir() | ||
if err != nil { | ||
return nil, err | ||
} | ||
} | ||
cachePath := filepath.Join(baseDir, lakectlDir, cacheDir) | ||
cachePath := filepath.Join(baseDir, LakectlDirName, CacheDirName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those sub diretories are irrelevant for this component.
It doesn't need to force or even know about LakectlDirName, CacheDirName
Closes #9480
Got rid of a lot of mess. no sync.Once nor global parameters. I mistakenly thought that abuse commands use separate clients for each iteration but was wrong.