Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

318
Visualizações
github copilot giving away API keys? how can I protect my keys?

I have installed and used github copilot for some time. And while working on a google maps project, I was curious and asked it to autocomplete the API url with the key open, and it listed suggestions with various API keys included. This got me worried since it generates codes based on other people code on github.

enter image description here

At first I was thinking those could be not functional keys, But I found that to be wrong based on this article.

So, how what methods can I use to protect my keys from such happening? I am thinking uninstalling wont help since my repos are already at github.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The only way to protect yourself is to not commit any private information to a public git repository.

Your Google Maps API key should be stored in an environment variable or a configuration file, and should never be checked into git.

A common way to do this for modern applications is to use environment variables in production and a .env file in development (that simulates using environment variables but actually holds the content of those variables in a local file). There are "dotenv" libraries available for just about every programming language. You will typically also create a .env.example file which you do commit to git that contains examples of all of the environment variables that your application requires, but does not contain actual secret values.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda