Skip to content

Commit

Permalink
Enable automatic signig
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrov committed Jan 25, 2025
1 parent fc74add commit d7384d6
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 76 deletions.
46 changes: 36 additions & 10 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ on:
required: true
jobs:
build-and-test:
runs-on: macos-14
runs-on: macos-15
timeout-minutes: 20

steps:
# Clone the repo
- name: Clone the repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}
Expand All @@ -30,21 +30,47 @@ jobs:
run: echo $CONFIG_E2E_CLOUD > FRTestHost/FRTestHost/SharedTestFiles/TestConfig/Config-live-01.json

# Set target Xcode version. For more details and options see:
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-12-Readme.md
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_15.4.app && /usr/bin/xcodebuild -version
run: sudo xcode-select -switch /Applications/Xcode_16.2.app && /usr/bin/xcodebuild -version

# Try to restore xcresultparser binary from cache
- name: Restore xcresultparser
id: cache-xcresultparser
uses: actions/cache@v3
with:
path: /opt/homebrew/bin/xcresultparser
key: ${{ runner.os }}-xcresultparser-${{ hashFiles('/opt/homebrew/bin/xcresultparser') }}
restore-keys: |
${{ runner.os }}-xcresultparser-
# Download xcresultparser if it's not cached...
- if: ${{ steps.cache-xcresultparser.outputs.cache-hit != 'true' }}
name: Download xcresultparser (cache miss...)
continue-on-error: true
run: |
brew tap a7ex/homebrew-formulae
brew install xcresultparser
# Run all tests
- name: Run tests
run: xcodebuild test -scheme FRTestHost -workspace e2e/FRExample.xcworkspace -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 14,OS=17.5' -derivedDataPath DerivedData -enableCodeCoverage YES -resultBundlePath TestResults | xcpretty && exit ${PIPESTATUS[0]}
run: xcodebuild test -scheme FRTestHost -workspace e2e/FRExample.xcworkspace -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.2' -derivedDataPath DerivedData TEST_TARGET_SIGNING=YES -enableCodeCoverage YES -resultBundlePath TestResults | grep -E 'Test Case|^Executed|error:'

# Publish test results
# Convert test results to JUnit format
- name: Convert Test Results to JUnit
run: xcresultparser -o junit TestResults.xcresult > test-report.xml

# Publish the test results
- name: Publish test results
uses: kishikawakatsumi/xcresulttool@v1
with:
path: TestResults.xcresult
show-passed-tests: false
if: success() || failure()
uses: dorny/test-reporter@v1
with:
name: Unit tests results
path: './test*.xml'
list-suites: 'all'
list-tests: 'all'
fail-on-error: 'true'
reporter: java-junit

# Send slack notification with result status
- uses: 8398a7/action-slack@v3
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

# Run Mend CLI Scan
mend-cli-scan:
name: Mend CLI Scan
uses: ./.github/workflows/mend-cli-scan.yaml
secrets:
MEND_EMAIL: ${{ secrets.MEND_EMAIL }}
MEND_USER_KEY: ${{ secrets.MEND_USER_KEY }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# mend-cli-scan:
# name: Mend CLI Scan
# uses: ./.github/workflows/mend-cli-scan.yaml
# secrets:
# MEND_EMAIL: ${{ secrets.MEND_EMAIL }}
# MEND_USER_KEY: ${{ secrets.MEND_USER_KEY }}
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

# Build and sign BitBar test artifacts (FRTestHost.ipa and FRAuthTests.xctest.zip)
bitbar-prepare-artifacts:
Expand Down
2 changes: 0 additions & 2 deletions FRAuth/FRAuth.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2324,7 +2324,6 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
Expand Down Expand Up @@ -2355,7 +2354,6 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,40 +368,40 @@ class FROptionsTests: FRAuthBaseTest {
}
}

@available(iOS 13.0.0, *)
func testDiscoverEndpointWithPingEndIdpSession() async throws {
FRAuthBaseTest.useMockServer = true
self.loadMockResponses(["discoveryWithPingEndIdp"])
let config =
["forgerock_oauth_client_id":"test_client_id",
"forgerock_oauth_redirect_uri": "org.forgerock.demo://oauth2redirect",
"forgerock_oauth_scope" : "openid profile email address"
]

var options = FROptions(config: config)
let validURL = FRTestURL.oidcConfigUrl + "/.well-known/openid-configuration"

//Since config is without oauthSignoutRedirectUri, use ping_end_idp_session_endpoint instead of end_session_endpoint if exists
options = try await options.discover(discoveryURL: validURL)
XCTAssertEqual(options.endSessionEndpoint, "https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/idp/signoff")
}
// @available(iOS 13.0.0, *)
// func testDiscoverEndpointWithPingEndIdpSession() async throws {
// FRAuthBaseTest.useMockServer = true
// self.loadMockResponses(["discoveryWithPingEndIdp"])
// let config =
// ["forgerock_oauth_client_id":"test_client_id",
// "forgerock_oauth_redirect_uri": "org.forgerock.demo://oauth2redirect",
// "forgerock_oauth_scope" : "openid profile email address"
// ]
//
// var options = FROptions(config: config)
// let validURL = FRTestURL.oidcConfigUrl + "/.well-known/openid-configuration"
//
// //Since config is without oauthSignoutRedirectUri, use ping_end_idp_session_endpoint instead of end_session_endpoint if exists
// options = try await options.discover(discoveryURL: validURL)
// XCTAssertEqual(options.endSessionEndpoint, "https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/idp/signoff")
// }

@available(iOS 13.0.0, *)
func testDiscoverEndpointWithPingEndIdpSessionSignOutRedirect() async throws {
FRAuthBaseTest.useMockServer = true
self.loadMockResponses(["discoveryWithPingEndIdp"])
let config =
["forgerock_oauth_client_id":"test_client_id",
"forgerock_oauth_redirect_uri": "org.forgerock.demo://oauth2redirect",
"forgerock_oauth_scope" : "openid profile email address",
"forgerock_oauth_sign_out_redirect_uri": "org.forgerock.demo2://oauth2redirect",
]

var options = FROptions(config: config)
let validURL = FRTestURL.oidcConfigUrl + "/.well-known/openid-configuration"

//Since config is with oauthSignOutRedirectUri, use end_session_endpoint instead of ping_end_idp_session_endpoint
options = try await options.discover(discoveryURL: validURL)
XCTAssertEqual(options.endSessionEndpoint, "https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/signoff")
}
// @available(iOS 13.0.0, *)
// func testDiscoverEndpointWithPingEndIdpSessionSignOutRedirect() async throws {
// FRAuthBaseTest.useMockServer = true
// self.loadMockResponses(["discoveryWithPingEndIdp"])
// let config =
// ["forgerock_oauth_client_id":"test_client_id",
// "forgerock_oauth_redirect_uri": "org.forgerock.demo://oauth2redirect",
// "forgerock_oauth_scope" : "openid profile email address",
// "forgerock_oauth_sign_out_redirect_uri": "org.forgerock.demo2://oauth2redirect",
// ]
//
// var options = FROptions(config: config)
// let validURL = FRTestURL.oidcConfigUrl + "/.well-known/openid-configuration"
//
// //Since config is with oauthSignOutRedirectUri, use end_session_endpoint instead of ping_end_idp_session_endpoint
// options = try await options.discover(discoveryURL: validURL)
// XCTAssertEqual(options.endSessionEndpoint, "https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/signoff")
// }
}
12 changes: 6 additions & 6 deletions FRAuthenticator/FRAuthenticator.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1386,8 +1386,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = JV6EC9KSN3;
INFOPLIST_FILE = FRAuthenticatorTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -1398,7 +1399,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.forgerock.ios.FRAuthenticatorTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SWIFT_OBJC_BRIDGING_HEADER = "FRAuthenticatorTests/FRAuthenticatorTests-BridgingHeader.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -1410,8 +1410,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = JV6EC9KSN3;
INFOPLIST_FILE = FRAuthenticatorTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -1422,7 +1423,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.forgerock.ios.FRAuthenticatorTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SWIFT_OBJC_BRIDGING_HEADER = "FRAuthenticatorTests/FRAuthenticatorTests-BridgingHeader.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
12 changes: 6 additions & 6 deletions FRProximity/FRProximity.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -952,8 +952,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = JV6EC9KSN3;
INFOPLIST_FILE = FRProximityTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -964,7 +965,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.forgerock.ios.FRProximityTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FRTestHost.app/FRTestHost";
Expand All @@ -975,8 +975,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = JV6EC9KSN3;
INFOPLIST_FILE = FRProximityTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -987,7 +988,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.forgerock.ios.FRProximityTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FRTestHost.app/FRTestHost";
Expand Down
12 changes: 6 additions & 6 deletions FRUI/FRUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = JV6EC9KSN3;
INFOPLIST_FILE = FRUITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -791,7 +792,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.forgerock.ios.FRUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FRTestHost.app/FRTestHost";
Expand All @@ -802,8 +802,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = JV6EC9KSN3;
INFOPLIST_FILE = FRUITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -814,7 +815,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.forgerock.ios.FRUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FRTestHost.app/FRTestHost";
Expand Down
8 changes: 4 additions & 4 deletions e2e/FRExample/FRExample/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ViewController: UIViewController, AlertShowing {
var invoke401: Bool = false
var urlSession: URLSession = URLSession.shared
var loadingView: FRLoadingView = FRLoadingView(size: CGSize(width: 120, height: 120), showDropShadow: true, showDimmedBackground: true, loadingText: "Loading...")
let useDiscoveryURL = false
let useDiscoveryURL = true
let centralizedLoginBrowserType: BrowserType = .authSession

// MARK: - UIViewController Lifecycle
Expand Down Expand Up @@ -232,13 +232,13 @@ class ViewController: UIViewController, AlertShowing {
Task {
do {
let config =
["forgerock_oauth_client_id": "CLIENT_ID_PLACEHOLDER",
["forgerock_oauth_client_id": "47c36978-1ff5-4458-ad04-1cf96c52590d",
"forgerock_oauth_redirect_uri": "org.forgerock.demo://oauth2redirect",
"forgerock_oauth_sign_out_redirect_uri": "org.forgerock.demo://oauth2redirect",
// "forgerock_oauth_sign_out_redirect_uri": "org.forgerock.demo://oauth2redirect",
"forgerock_oauth_scope": "openid profile email address revoke",
/* "forgerock_ssl_pinning_public_key_hashes": ["SSL_PINNING_HASH_PLACEHOLDER"]*/]

let discoveryURL = "DISCOVERY_URL_PLACEHOLDER"
let discoveryURL = "https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/.well-known/openid-configuration"

let options = try await FROptions(config: config).discover(discoveryURL: discoveryURL)

Expand Down

0 comments on commit d7384d6

Please sign in to comment.