Skip to content

Commit c2fbc77

Browse files
Use secure rules for Firebase Storage Integration tests (#5643)
1 parent e5a1360 commit c2fbc77

File tree

13 files changed

+288
-163
lines changed

13 files changed

+288
-163
lines changed

.github/workflows/storage.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ jobs:
2727
- name: Install Secret GoogleService-Info.plist
2828
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/storage-db-plist.gpg \
2929
FirebaseStorage/Tests/Integration/Resources/GoogleService-Info.plist "$plist_secret"
30+
- name: Install Credentials.h
31+
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Storage/Credentials.h.gpg \
32+
FirebaseStorage/Tests/Integration/Credentials.h "$plist_secret"
33+
- name: Install Credentials.swift
34+
run: |
35+
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Storage/Credentials.swift.gpg \
36+
FirebaseStorage/Tests/SwiftIntegration/Credentials.swift "$plist_secret"
37+
cp FirebaseStorage/Tests/SwiftIntegration/Credentials.swift FirebaseStorageSwift/Tests/Integration/
3038
- name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
3139
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh ${{ matrix.pod }} all)
3240

@@ -65,7 +73,9 @@ jobs:
6573

6674
strategy:
6775
matrix:
68-
target: [ios, tvos, macos, watchos]
76+
# watchos is disabled since pod lib lint cannot handle test Auth dep even if the dep is only
77+
# specified for the other three platforms.
78+
target: [ios, tvos, macos]
6979
steps:
7080
- uses: actions/checkout@v2
7181
- name: Setup Bundler
@@ -80,7 +90,7 @@ jobs:
8090
if: github.event_name == 'schedule'
8191
strategy:
8292
matrix:
83-
target: [ios, tvos, macos, watchos]
93+
target: [ios, tvos, macos]
8494
flags: [
8595
'--skip-tests --use-modular-headers',
8696
'--skip-tests --use-libraries'

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ FirebaseMessaging/Tests/IntegrationTests/Resources/GoogleService-Info.plist
2424
# FirebaseMessaging test app GoogleService-Info.plist
2525
FirebaseMessaging/Apps/Sample/Sample/GoogleService-Info.plist
2626

27+
# Credentials for Firebase Storage Integration Tests
28+
FirebaseStorage/Tests/Integration/Credentials.h
29+
FirebaseStorage/Tests/SwiftIntegration/Credentials.swift
30+
FirebaseStorageSwift/Tests/Integration/Credentials.swift
31+
2732
Secrets.tar
2833

2934
# OS X

FirebaseStorage.podspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Firebase Storage provides robust, secure file uploads and downloads from Firebas
5252
int_tests.requires_app_host = true
5353
int_tests.resources = 'FirebaseStorage/Tests/Integration/Resources/1mb.dat',
5454
'FirebaseStorage/Tests/Integration/Resources/GoogleService-Info.plist'
55+
int_tests.dependency 'FirebaseAuth', '~> 6.5'
5556
end
5657

5758
s.test_spec 'swift-integration' do |swift_int_tests|
@@ -60,5 +61,6 @@ Firebase Storage provides robust, secure file uploads and downloads from Firebas
6061
swift_int_tests.requires_app_host = true
6162
swift_int_tests.resources = 'FirebaseStorage/Tests/Integration/Resources/1mb.dat',
6263
'FirebaseStorage/Tests/Integration/Resources/GoogleService-Info.plist'
64+
swift_int_tests.dependency 'FirebaseAuth', '~> 6.5'
6365
end
6466
end
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/*
18+
Some of the Credentials needs to be populated for the Integration Tests.
19+
Please follow the following steps to populate the valid Credentials
20+
and copy it to Credentials.swift file:
21+
22+
You will need to replace the following values:
23+
$KUSER_NAME
24+
The name of the user for Auth SignIn
25+
$KPASSWORD
26+
The password.
27+
*/
28+
29+
#define KUSER_NAME $KUSER_NAME
30+
#define KPASSWORD $KPASSWORD

0 commit comments

Comments
 (0)