Giter VIP home page Giter VIP logo

Comments (5)

yonaskolb avatar yonaskolb commented on May 7, 2024 2

Ah I see. Without creating your own simple server that validates encrypted keys and forwards calls to Google, I'm not sure how you can make this completely secure.

You could compile the key into the binary somehow but only if building manually, and it couldn't be built by mint. Even then someone clever could probably extract the key out of your binary if they wanted to, but that is probably hard enough that no-one would bother πŸ˜„

I'm not a security expert though so there might be another way to do what you're after

from mint.

yonaskolb avatar yonaskolb commented on May 7, 2024 1

Hi @shpakovski, glad you like it!

I'm not sure I 100% understand your question, but you would like to use some api keys in your swift command line tool right? I don't know if accessing them during mint install is the best place, but rather in your executable itself when it runs.
There are various ways of accessing these in your command line tool, for example:

  • passing by an argument (must be done everytime)
  • an environment variable (can be setup within someones toolchain)
  • have some file at a standard path that it reads from
  • some way of saving and loading it within the tool, to local storage or preferably the keychain. Your command could ask for it interactively if it doesn't have the key yet, or require them to pass it in the first time.

Hope that helps, sorry if I've misunderstood your question.

from mint.

shpakovski avatar shpakovski commented on May 7, 2024

Yes, there is a bit of misunderstanding, sorry πŸ˜…

The thing is that I don’t want all customers of the CLI to generate their own API Keys in order to use the app. My command-line tool is similar to any mobile client: it runs the OAuth login page with a custom identifier and secret string to acquire the access token per device!

So those keys must be in the binary but not in the codebase πŸ™‡β€β™‚οΈ Thanks again!

Update: I’m talking about smth like this but for CLI: https://tgvashworth.com/2013/04/11/keeping-open-source-secrects.html How do I lend out my own keys to install the Swift app on any Mac?

from mint.

shpakovski avatar shpakovski commented on May 7, 2024

Right, the secret string should be in the binary but not in the codebase πŸ™Œ

Without creating your own simple server that validates encrypted keys and forwards calls to Google.

This is probably a way to go, thanks a lot! I will just modify this approach a bit πŸ‘Œ

from mint.

shpakovski avatar shpakovski commented on May 7, 2024

Follow-up, if you’re curious: https://stackoverflow.com/questions/1983990/how-to-open-source-an-application-that-uses-api-keys I.e. such command-line tools should be distributed as binaries, so mint is not suitable for such cases. I will use it next time though, thanks again! πŸ˜„

from mint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.