Skip to content
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

Merged
merged 4 commits into from
Jul 11, 2017
Merged

Allow binary cert/key in apns_connection like v1 #195

merged 4 commits into from
Jul 11, 2017

Conversation

danielfinke
Copy link
Contributor

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.

-type type() :: cert | token.
-type type() :: certdata | cert | token.
-type keydata() :: {'RSAPrivateKey' | 'DSAPrivateKey' | 'ECPrivateKey' | 'PrivateKeyInfo'
,binary()}.
Copy link

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

@@ -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'
Copy link

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'.

@@ -256,10 +278,18 @@ host(#{apple_host := Host}) ->
port(#{apple_port := Port}) ->
Port.

-spec cert(connection()) -> binary().
cert(#{certdata := Cert}) ->
Copy link
Member

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

-spec certfile(connection()) -> path().
certfile(#{certfile := Certfile}) ->
Certfile.

-spec key(connection()) -> keydata().
key(#{keydata := Key}) ->
Copy link
Member

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

@ferigis
Copy link
Member

ferigis commented Jul 11, 2017

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

@ferigis ferigis merged commit 6fec6d1 into inaka:master Jul 11, 2017
@danielfinke
Copy link
Contributor Author

Thanks!

@ferigis
Copy link
Member

ferigis commented Jul 11, 2017

@danielfinke merged. Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants