Skip to content
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
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Test

on:
push:
branches: main
branches:
- main
pull_request:

jobs:
Expand All @@ -26,5 +27,7 @@ jobs:
.build/repositories
key: google-cloud-swift_build_${{ runner.os }}_${{ hashFiles('Package.resolved') }}
- run: swift build
- name: swift test
- if: matrix.swift == '6.2' # swift 6.0 does not support test scoping yet
name: Run test
run: ./run_test.sh

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let package = Package(
.library(name: "GoogleCloud", targets: ["GoogleCloud"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "4.0.0"),
.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "5.0.0"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.24.0"),
.package(url: "https://github.com/vapor/jwt-kit.git", from: "5.1.1"),
],
Expand Down
8 changes: 6 additions & 2 deletions Sources/FirebaseAdmin/Auth/Auth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public struct Auth: Sendable {
projectID paramProjectID: String? = nil
) throws {
var credential = client.credential
var baseURL: URL
let baseURL: URL
guard let projectID = paramProjectID ?? Self.projectID(from: credential) else {
throw AuthError(message: "projectID must be provided if the credential doesn't have it.")
}
Expand Down Expand Up @@ -137,7 +137,7 @@ public struct Auth: Sendable {

private func user(
request: GetUserRequest,
logger: Logger?
logger: Logger? = nil
) async throws -> UserRecord? {
let path = "/accounts:lookup"
let res = try await baseClient.post(
Expand Down Expand Up @@ -234,4 +234,8 @@ public struct Auth: Sendable {
responseType: ListUserResult.self
)
}

public func customToken(uid: String) async throws -> String {
fatalError("TODO")
}
}
5 changes: 4 additions & 1 deletion Sources/FirebaseAdmin/Auth/HTTPKeySource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ struct HTTPKeySource {
}
}

init(client: HTTPClient, clock: some Clock<Duration> = .continuous) {
init(
client: HTTPClient = .shared,
clock: some Clock<Duration> = .continuous
) {
self.client = client
let willRefreshKeys = NIOLockedValueBox<(@Sendable () -> ())?>(nil)
self.willRefreshKeys = willRefreshKeys
Expand Down
4 changes: 2 additions & 2 deletions Sources/GoogleCloud/BigQuery/BigQuery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public struct BigQuery: Sendable {
public var useLegacySql: Bool = false
}

public func query<Row: Decodable>(
public func query<Row: Decodable & GCSSendableMetatype>(
_ query: BigQueryQueryString,
options: QueryOptions = QueryOptions(),
decoding rowType: Row.Type,
Expand All @@ -58,7 +58,7 @@ public struct BigQuery: Sendable {
.reduce(into: [], { $0.append(contentsOf: $1) })
}

public func queryStream<Row: Decodable>(
public func queryStream<Row: Decodable & GCSSendableMetatype>(
_ query: BigQueryQueryString,
options: QueryOptions = QueryOptions(),
decoding rowType: Row.Type,
Expand Down
5 changes: 5 additions & 0 deletions Sources/GoogleCloudBase/Util/SendableMetatype.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#if swift(>=6.2)
public typealias GCSSendableMetatype = SendableMetatype
#else
public typealias GCSSendableMetatype = Any
#endif
Loading