Skip to content

Commit 1cb0bb9

Browse files
committed
Config: Switch to encrypted credentials
And fix missing "%" in the `connect_to_development_server` template key.
1 parent e606da7 commit 1cb0bb9

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ shared:
7575
apple:
7676
# Token auth params
7777
# See https://developer.apple.com/documentation/usernotifications/establishing-a-token-based-connection-to-apns
78-
key_id: your_key_id
79-
encryption_key: your_apple_encryption_key
78+
key_id: <%= Rails.application.credentials.dig(:action_push_native, :apns, :key_id) %>
79+
encryption_key: <%= Rails.application.credentials.dig(:action_push_native, :apns, :encryption_key) %>
8080

8181
team_id: your_apple_team_id
8282
# Your identifier found on https://developer.apple.com/account/resources/identifiers/list
@@ -85,7 +85,7 @@ shared:
8585
google:
8686
# Your Firebase project service account credentials
8787
# See https://firebase.google.com/docs/cloud-messaging/auth-server
88-
encryption_key: your_service_account_json_file
88+
encryption_key: <%= Rails.application.credentials.dig(:action_push_native, :fcm, :encryption_key) %>
8989

9090
# Firebase project_id
9191
project_id: your_project_id
@@ -130,32 +130,32 @@ shared:
130130
calendar:
131131
# Token auth params
132132
# See https://developer.apple.com/documentation/usernotifications/establishing-a-token-based-connection-to-apns
133-
key_id: calendar_key_id
134-
encryption_key: calendar_apple_encryption_key
133+
key_id: <%= Rails.application.credentials.dig(:action_push_native, :apns, :calendar, :key_id) %>
134+
encryption_key: <%= Rails.application.credentials.dig(:action_push_native, :apns, :calendar, :encryption_key) %>
135135
# Your identifier found on https://developer.apple.com/account/resources/identifiers/list
136136
topic: calendar.bundle.identifier
137137
138138
email:
139139
# Token auth params
140140
# See https://developer.apple.com/documentation/usernotifications/establishing-a-token-based-connection-to-apns
141-
key_id: email_key_id
142-
encryption_key: email_apple_encryption_key
141+
key_id: <%= Rails.application.credentials.dig(:action_push_native, :apns, :email, :key_id) %>
142+
encryption_key: <%= Rails.application.credentials.dig(:action_push_native, :apns, :email, :encryption_key) %>
143143
# Your identifier found on https://developer.apple.com/account/resources/identifiers/list
144144
topic: email.bundle.identifier
145145
146146
google:
147147
calendar:
148148
# Your Firebase project service account credentials
149149
# See https://firebase.google.com/docs/cloud-messaging/auth-server
150-
encryption_key: calendar_service_account_json_file
150+
encryption_key: <%= Rails.application.credentials.dig(:action_push_native, :fcm, :calendar, :encryption_key) %>
151151
152152
# Firebase project_id
153153
project_id: calendar_project_id
154154
155155
email:
156156
# Your Firebase project service account credentials
157157
# See https://firebase.google.com/docs/cloud-messaging/auth-server
158-
encryption_key: email_service_account_json_file
158+
encryption_key: <%= Rails.application.credentials.dig(:action_push_native, :fcm, :email, :encryption_key) %>
159159
160160
# Firebase project_id
161161
project_id: email_project_id

lib/generators/action_push_native/install/templates/config/push.yml.tt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
shared:
2+
# Use bin/rails credentials:edit to set the apns secrets (as action_push_native:apns:key_id|encryption_key)
23
apple:
34
# Token auth params
45
# See https://developer.apple.com/documentation/usernotifications/establishing-a-token-based-connection-to-apns
5-
key_id: your_key_id
6-
encryption_key: your_apple_encryption_key
6+
key_id: <%%= Rails.application.credentials.dig(:action_push_native, :apns, :key_id) %>
7+
encryption_key: <%%= Rails.application.credentials.dig(:action_push_native, :apns, :encryption_key) %>
78

89
team_id: your_apple_team_id
910
# Your identifier found on https://developer.apple.com/account/resources/identifiers/list
@@ -20,12 +21,13 @@ shared:
2021
# Please note that anything built directly from Xcode and loaded on your phone will have
2122
# the app generate DEVELOPMENT tokens, while everything else (TestFlight, Apple Store, ...)
2223
# will be considered as PRODUCTION environment.
23-
# connect_to_development_server: <%# Rails.env.development? %>
24+
# connect_to_development_server: <%%# Rails.env.development? %>
2425

26+
# Use bin/rails credentials:edit to set the fcm secrets (as action_push_native:fcm:encryption_key)
2527
google:
2628
# Your Firebase project service account credentials
2729
# See https://firebase.google.com/docs/cloud-messaging/auth-server
28-
encryption_key: your_service_account_json_file
30+
encryption_key: <%%= Rails.application.credentials.dig(:action_push_native, :fcm, :encryption_key) %>
2931

3032
# Firebase project_id
3133
project_id: your_project_id

test/dummy/config/push.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
shared:
2+
# Use bin/rails credentials:edit to set the apns secrets (as action_push_native:apns:key_id|encryption_key)
23
apple:
34
# Token auth params
45
# See https://developer.apple.com/documentation/usernotifications/establishing-a-token-based-connection-to-apns
5-
key_id: your_key_id
6-
encryption_key: your_apple_encryption_key
6+
key_id: <%= Rails.application.credentials.dig(:action_push_native, :apns, :key_id) %>
7+
encryption_key: <%= Rails.application.credentials.dig(:action_push_native, :apns, :encryption_key) %>
78

89
team_id: your_apple_team_id
910
# Your identifier found on https://developer.apple.com/account/resources/identifiers/list
@@ -22,10 +23,11 @@ shared:
2223
# will be considered as PRODUCTION environment.
2324
# connect_to_development_server: <%# Rails.env.development? %>
2425

26+
# Use bin/rails credentials:edit to set the fcm secrets (as action_push_native:fcm:encryption_key)
2527
google:
2628
# Your Firebase project service account credentials
2729
# See https://firebase.google.com/docs/cloud-messaging/auth-server
28-
encryption_key: your_service_account_json_file
30+
encryption_key: <%= Rails.application.credentials.dig(:action_push_native, :fcm, :encryption_key) %>
2931

3032
# Firebase project_id
3133
project_id: your_project_id

0 commit comments

Comments
 (0)