Skip to content

Use secure rules for Firebase Storage Integration tests #5643

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

Merged
merged 19 commits into from
May 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ jobs:
- name: Install Secret GoogleService-Info.plist
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/storage-db-plist.gpg \
FirebaseStorage/Tests/Integration/Resources/GoogleService-Info.plist "$plist_secret"
- name: Install Credentials.h
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Storage/Credentials.h.gpg \
FirebaseStorage/Tests/Integration/Credentials.h "$plist_secret"
- name: Install Credentials.swift
run: |
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Storage/Credentials.swift.gpg \
FirebaseStorage/Tests/SwiftIntegration/Credentials.swift "$plist_secret"
cp FirebaseStorage/Tests/SwiftIntegration/Credentials.swift FirebaseStorageSwift/Tests/Integration/
- name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh ${{ matrix.pod }} all)

Expand Down Expand Up @@ -65,7 +73,9 @@ jobs:

strategy:
matrix:
target: [ios, tvos, macos, watchos]
# watchos is disabled since pod lib lint cannot handle test Auth dep even if the dep is only
# specified for the other three platforms.
target: [ios, tvos, macos]
steps:
- uses: actions/checkout@v2
- name: Setup Bundler
Expand All @@ -80,7 +90,7 @@ jobs:
if: github.event_name == 'schedule'
strategy:
matrix:
target: [ios, tvos, macos, watchos]
target: [ios, tvos, macos]
flags: [
'--skip-tests --use-modular-headers',
'--skip-tests --use-libraries'
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ FirebaseMessaging/Tests/IntegrationTests/Resources/GoogleService-Info.plist
# FirebaseMessaging test app GoogleService-Info.plist
FirebaseMessaging/Apps/Sample/Sample/GoogleService-Info.plist

# Credentials for Firebase Storage Integration Tests
FirebaseStorage/Tests/Integration/Credentials.h
FirebaseStorage/Tests/SwiftIntegration/Credentials.swift
FirebaseStorageSwift/Tests/Integration/Credentials.swift

Secrets.tar

# OS X
Expand Down
2 changes: 2 additions & 0 deletions FirebaseStorage.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Firebase Storage provides robust, secure file uploads and downloads from Firebas
int_tests.requires_app_host = true
int_tests.resources = 'FirebaseStorage/Tests/Integration/Resources/1mb.dat',
'FirebaseStorage/Tests/Integration/Resources/GoogleService-Info.plist'
int_tests.dependency 'FirebaseAuth', '~> 6.5'
end

s.test_spec 'swift-integration' do |swift_int_tests|
Expand All @@ -60,5 +61,6 @@ Firebase Storage provides robust, secure file uploads and downloads from Firebas
swift_int_tests.requires_app_host = true
swift_int_tests.resources = 'FirebaseStorage/Tests/Integration/Resources/1mb.dat',
'FirebaseStorage/Tests/Integration/Resources/GoogleService-Info.plist'
swift_int_tests.dependency 'FirebaseAuth', '~> 6.5'
end
end
30 changes: 30 additions & 0 deletions FirebaseStorage/Tests/Integration/Credentials.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
Some of the Credentials needs to be populated for the Integration Tests.
Please follow the following steps to populate the valid Credentials
and copy it to Credentials.swift file:

You will need to replace the following values:
$KUSER_NAME
The name of the user for Auth SignIn
$KPASSWORD
The password.
*/

#define KUSER_NAME $KUSER_NAME
#define KPASSWORD $KPASSWORD
Loading