Hiding private details from open source projects

后端 未结 4 565
轻奢々
轻奢々 2021-02-11 07:39

I have a .net github project that is basically a wrapper around a web API. In the test project, I am calling to the API using an API key. I need to keep this key private, how do

4条回答
  •  半阙折子戏
    2021-02-11 08:05

    One option is to use .config files instead of having secret keys hardcoded in sources.

    More info Using Settings in C# and step-by-step guide

    
       
          
       
    
    
    
    var secretKey = ConfigurationManager.AppSettings.Get("SecretKey");
    

提交回复
热议问题