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

[FEATURE] Supply auth_cmd #176

Closed
erichlf opened this issue Jun 11, 2024 · 9 comments
Closed

[FEATURE] Supply auth_cmd #176

erichlf opened this issue Jun 11, 2024 · 9 comments

Comments

@erichlf
Copy link

erichlf commented Jun 11, 2024

Is your feature request related to a problem? Please describe.
My development environment is in docker containers and so every time I restart a docker container I have to re-authorize tabnine. It would be nice if there could be an automated way to authorize the tabnine plugin.

Describe the solution you'd like
Add the ability to supply an auth_cmd where the output of this command is a string containing the authorization token. I tend to store authorization tokens and api keys in gnu pass and so one possible command would be pass show tabnine/auth_token. But this command could be anything that results in a string that is the auth token.

Describe alternatives you've considered
I would consider most anything that makes it where I don't have to manually enter the auth token. However, solutions like storing in an environment variable should be avoided.

@amirbilu
Copy link
Contributor

@erichlf are you referring to api keys given to old pro users?

@erichlf
Copy link
Author

erichlf commented Jun 11, 2024

Sorry I mean AUTH Token. I have corrected the description.

@erichlf erichlf changed the title [FEATURE] Supply api_key_cmd [FEATURE] Supply auth_cmd Jun 11, 2024
@amirbilu
Copy link
Contributor

The auth token lives for 1 hour so this won't work. What other plugins do?

@amirbilu
Copy link
Contributor

A nice workaround could be to mount ~/.config/TabNine. Assuming you're logged-in in the host

@erichlf
Copy link
Author

erichlf commented Jun 14, 2024

That is good to know.

@amirbilu
Copy link
Contributor

Does it work for you?

@erichlf
Copy link
Author

erichlf commented Jun 15, 2024

I have to figure out why when I bind mount the directory, or use it as a volume it becomes owned by root and I don't have permissions to do anything with it.

@erichlf
Copy link
Author

erichlf commented Jun 20, 2024

The issue is that ~/.config doesn't already exist in the container and so when ~/.config/TabNine is mounted it will then create the ~/.config directory giving to root ownership, which then breaks all sorts of other things that I have going on that depends on that directory having non-root ownership. What I do as a workaround is that put the following in my dotfiles setup script:

if [[ -d $HOME/.config && ! $(stat -c "%U" $HOME/.config) == "$(whoami)" ]]; then
  sudo chown $UID $HOME/.config 
fi

Once I got the permissions fixed then I was able to get neovim up and running and then I saw that tabnine was working.

@amirbilu
Copy link
Contributor

Closing this

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

No branches or pull requests

2 participants