bytefish / FcmSharp

Firebase Cloud Messaging (FCM) with .NET
MIT License
6 stars 7 forks source link

Create settings (credentials) via parameter #60

Closed EnricoWuestenberg closed 5 years ago

EnricoWuestenberg commented 5 years ago

The only way to load credentials is via file. Blank files are a security issue. I use a deployment pipeline and need to replace variables.

Something like FileBasedFcmClientSettings.Create(FcmClientSettingsConfig config) would be nice.

grafik

bytefish commented 5 years ago

Can you give me an example? The FileBasedFcmClientSettings is just a class with static helper methods. You can easily create your own helper methods to generate the credentials. There is also a StreamBasedFcmClientSettings to create the credentials from a Stream for example:

bytefish commented 5 years ago

Please implement the methods you need to safely load the credentials in your applications code. You say "blank files are a security issue", but I fail to see how you can load empty files, because an exception will be thrown:

As you can see, the FileBasedFcmClientSettings and StreamBasedFcmClientSettings are no magic, so it will be easy to adapt it to your needs.