-
Notifications
You must be signed in to change notification settings - Fork 216
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
Allow binary cert/key in apns_connection like v1 #195
Conversation
src/apns_connection.erl
Outdated
-type type() :: cert | token. | ||
-type type() :: certdata | cert | token. | ||
-type keydata() :: {'RSAPrivateKey' | 'DSAPrivateKey' | 'ECPrivateKey' | 'PrivateKeyInfo' | ||
,binary()}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space right "," on line 65
src/apns_connection.erl
Outdated
@@ -58,11 +60,15 @@ | |||
-type host() :: string() | inet:ip_address(). | |||
-type path() :: string(). | |||
-type notification() :: binary(). | |||
-type type() :: cert | token. | |||
-type type() :: certdata | cert | token. | |||
-type keydata() :: {'RSAPrivateKey' | 'DSAPrivateKey' | 'ECPrivateKey' | 'PrivateKeyInfo' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 64 is too long: -type keydata() :: {'RSAPrivateKey' | 'DSAPrivateKey' | 'ECPrivateKey' | 'PrivateKeyInfo'.
src/apns_connection.erl
Outdated
@@ -256,10 +278,18 @@ host(#{apple_host := Host}) -> | |||
port(#{apple_port := Port}) -> | |||
Port. | |||
|
|||
-spec cert(connection()) -> binary(). | |||
cert(#{certdata := Cert}) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this getter function should be called certdata/1
src/apns_connection.erl
Outdated
-spec certfile(connection()) -> path(). | ||
certfile(#{certfile := Certfile}) -> | ||
Certfile. | ||
|
||
-spec key(connection()) -> keydata(). | ||
key(#{keydata := Key}) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this getter function should be called keydata/1
Hi @danielfinke Thanks for your contribution! :) I have requested two little changes. You could add a test with your new feature. after that we will merge it |
Thanks! |
@danielfinke merged. Thanks for contributing! |
We store the APNS provider cert/key in a shared database, so we prefer to be able to supply this information directly to the apns4erl library, avoiding a file on disk.
This PR adds back support (previously in v1) to set cert/key binary data on the apns_connection.