GithubHelp home page GithubHelp logo

googleapis / google-auth-library-swift Goto Github PK

View Code? Open in Web Editor NEW
132.0 50.0 58.0 201 KB

Auth client library for Swift command-line tools and cloud services. Supports OAuth1, OAuth2, and Google Application Default Credentials.

License: Apache License 2.0

Swift 92.11% Makefile 0.12% Ruby 1.88% JavaScript 5.88%
experimental

google-auth-library-swift's Introduction

Swift Actions Status

Auth Library for Swift

This project contains Swift packages that can be used to write command-line tools and cloud services that use OAuth to authenticate and authorize access to remote services.

Currently these packages support OAuth1 and OAuth2. They are designed to work on macOS systems and on Linux systems that are running in the Google Cloud.

  • On macOS systems, OAuth tokens can be obtained using the locally-installed browser and a local web server that is automatically run in the command-line client.

  • On Linux systems, OAuth tokens can be obtained automatically from the Google Cloud Metadata Service.

  • On both Linux and macOS systems, OAuth tokens can be obtained automatically for Google Cloud Service Accounts.

Usage and Examples

Sources/Examples contains examples that illustrate OAuth1 and OAuth2 signin for various services. Each requires valid application credentials to run. See the various service providers for details.

The BrowserTokenProvider classes use a local web server to implement "three-legged OAuth" signin in which users grant permission in a browser that a provider's server redirects to the client server with a code. These providers look for OAuth configuration information in "credentials" YAML files that are expected to be in $HOME/.credentials. Sample credentials files are in credentials and include client IDs, client secrets, and OAuth service URLs. When OAuth services require registered callback URLs, these should be set to http://localhost:8080/SERVICE/callback where SERVICE is specified in the corresponding credentials YAML file. The temporary web server runs locally on port 8080.

Credits

  • The local web server is built using swift-nio/http.
  • HMAC and SHA1 hashing is performed using CryptoSwift.
  • RSA signing of service account JWT tokens uses BigInt.

Disclaimer

This is work in progress toward great server-side Swift software. Please take care when using this in production projects: always refer to a tagged version and be aware that interfaces may change in future releases.

Contributing

We'd love to collaborate on this. See CONTRIBUTING.md for details.

Copyright

Copyright 2019, Google LLC.

License

Released under the Apache 2.0 license.

google-auth-library-swift's People

Contributors

0xced avatar alexlaurinmath avatar barrault01 avatar dcow avatar dlewanda avatar dweekly avatar google-cloud-policy-bot[bot] avatar jgh- avatar justinbeckwith avatar kant avatar leisurehound avatar marcocanc avatar michaelmcguire avatar moyerr avatar renovate-bot avatar santhoshvaddi avatar timburks avatar tremblay avatar ysak-y avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-auth-library-swift's Issues

Xcode 10 Swift 4.2 Support

I'm having problems adding AuthLibrary via Pods. I assume its due to Xcode 10 and Swift 4.2.

Is any support of Xcode 10 and Swift 4.2 planned?

[Policy Bot] found one or more issues with this repository.

Policy Bot found one or more issues with this repository.

  • Default branch is 'main'
  • Branch protection is enabled
  • Renovate bot is enabled
  • Merge commits disabled
  • There is a CODEOWNERS file
  • There is a valid LICENSE.md
  • There is a CODE_OF_CONDUCT.md
  • There is a CONTRIBUTING.md
  • There is a SECURITY.md

Service account support (JWT signing with RS256)

To call Google Cloud APIs, it would be very useful to have a way to get OAuth tokens for Google Cloud service accounts.

The authentication process is described here, but so far I have not found appropriate Swift libraries to use for this or for the key step of signing the request JWT token using RSA SHA-256.

In other contexts, Google engineers have strongly discouraged implementations of this for client-side authentication because clients are unable to effectively protect service account private keys.

But this would be primarily to support server-side Swift.

Can't build in new Xcode project if install this library

Environment details

  • Programming language: Swift
  • OS: iOS (I tried 15.0 and 13.3 as deployment target)
  • Language runtime version: Swift 5
  • Package version: 0.5.0

Steps to reproduce

  1. Run pod init and pod install with following Podfile.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'MyTestApp' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  pod 'AuthLibrary', :git => 'https://github.com/googleapis/google-auth-library-swift.git'

end
  1. open MyTestApp.xcworkspace and import AuthLibrary in somewhere, then build.
  2. Finally, I got following error

/Users/yoshiakiyamada/git/MyTestApp/Pods/AuthLibrary/Sources/OAuth2/Code.swift:20:8: error: no such module 'NIOHTTP1' import NIOHTTP1

This library works finely 1~2 months ago (At least mid of November) but failed to build at now.
Can you build it now? How can I avoid it?

Swift Compiler Crash on Swift Dev Trunk

I haven't received any responses to tensorflow/swift#522, so I will see if this is relevant here. I don't know if this is a compiler bug or a library bug.

On Ubuntu 18.04, google-auth-library-swift successfully compiles with the Swift for Tensorflow v0.10 Toolchain, but it causes a build crash on the recently released v0.11 toolchain:

$ git clone https://github.com/googleapis/google-auth-library-swift
$ cd google-auth-library-swift
$ rm -rf .build/
$ which swift
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift
$ swift --version
Swift version 5.3-dev (LLVM db8896f3f345af2, Swift 61684f62a6132c0)
Target: x86_64-unknown-linux-gnu
$ swift build
Fetching https://github.com/apple/swift-nio.git
Fetching https://github.com/krzyzanowskim/CryptoSwift.git
Fetching https://github.com/attaswift/BigInt
Cloning https://github.com/krzyzanowskim/CryptoSwift.git
Resolving https://github.com/krzyzanowskim/CryptoSwift.git at 1.3.1
Cloning https://github.com/attaswift/BigInt
Resolving https://github.com/attaswift/BigInt at 5.1.0
Cloning https://github.com/apple/swift-nio.git
Resolving https://github.com/apple/swift-nio.git at 2.21.0
[1/30] Compiling CNIOSHA1 c_nio_sha1.c
[2/30] Compiling CNIOLinux shim.c
[3/30] Compiling CNIOLinux ifaddrs-android.c
[4/63] Compiling CNIOHTTPParser c_nio_http_parser.c
[5/63] Compiling CNIODarwin shim.c
swift-frontend: /swift-base/swift/lib/AST/GenericSignature.cpp:251: static swift::CanGenericSignature swift::CanGenericSignature::getCanonical(TypeArrayView<swift::GenericTypeParamType>, ArrayRef<swift::Requirement>, bool): Assertion `isCanonicalAnchor(secondType)' failed.
Stack dump:
0.	Program arguments: /home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend -frontend -c /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Addition.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/BigInt.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/BigUInt.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Bitwise Ops.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Codable.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Comparable.swift -primary-file /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Data Conversion.swift -primary-file /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Division.swift -primary-file /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Exponentiation.swift -primary-file /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Floating Point Conversion.swift -primary-file /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/GCD.swift -primary-file /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Hashable.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Integer Conversion.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Multiplication.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Prime Test.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Random.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Shifts.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Square Root.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Strideable.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/String Conversion.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Subtraction.swift /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Words and Bits.swift -supplementary-output-file-map /tmp/supplementaryOutputs-2b70e2 -target x86_64-unknown-linux-gnu -disable-objc-interop -I /home/xander/dev/google-auth-library-swift/.build/x86_64-unknown-linux-gnu/debug -enable-testing -g -module-cache-path /home/xander/dev/google-auth-library-swift/.build/x86_64-unknown-linux-gnu/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -enable-anonymous-context-mangled-names -parse-as-library -module-name BigInt -o /home/xander/dev/google-auth-library-swift/.build/x86_64-unknown-linux-gnu/debug/BigInt.build/Data Conversion.swift.o -o /home/xander/dev/google-auth-library-swift/.build/x86_64-unknown-linux-gnu/debug/BigInt.build/Division.swift.o -o /home/xander/dev/google-auth-library-swift/.build/x86_64-unknown-linux-gnu/debug/BigInt.build/Exponentiation.swift.o -o /home/xander/dev/google-auth-library-swift/.build/x86_64-unknown-linux-gnu/debug/BigInt.build/Floating Point Conversion.swift.o -o /home/xander/dev/google-auth-library-swift/.build/x86_64-unknown-linux-gnu/debug/BigInt.build/GCD.swift.o -o /home/xander/dev/google-auth-library-swift/.build/x86_64-unknown-linux-gnu/debug/BigInt.build/Hashable.swift.o -index-store-path /home/xander/dev/google-auth-library-swift/.build/x86_64-unknown-linux-gnu/debug/index/store -index-system-modules 
1.	Swift version 5.3-dev (LLVM db8896f3f345af2, Swift 61684f62a6132c0)
2.	While evaluating request TypeCheckSourceFileRequest(source_file "/home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Division.swift")
3.	While type-checking extension of FixedWidthInteger (at /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Division.swift:11:1)
4.	While type-checking declaration 0x96aa840 (at /home/xander/dev/google-auth-library-swift/.build/checkouts/BigInt/Sources/Division.swift:12:13)
5.	While evaluating request PatternBindingEntryRequest((unknown decl), 0)
6.	While evaluating request PatternTypeRequest((pattern @ 0x96aa428))
7.	While canonicalizing generic signature <τ_0_0 where τ_0_0 : FixedWidthInteger, τ_0_0 == τ_0_0.Magnitude, τ_0_0.Magnitude == τ_0_0.Magnitude.Magnitude.Magnitude> in requirement #2
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x5214dc4]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x52129be]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x521509c]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x128a0)[0x7fe170bf18a0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7fe16f493f47]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7fe16f4958b1]
/lib/x86_64-linux-gnu/libc.so.6(+0x3042a)[0x7fe16f48542a]
/lib/x86_64-linux-gnu/libc.so.6(+0x304a2)[0x7fe16f4854a2]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x193f72e]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x193e98d]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x193e87c]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x193fb27]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x18805a5]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x1418ecf]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x13a2636]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x13f4788]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x13a8cb7]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x13a87b6]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x13a1f61]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x13a1f34]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x1400212]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x137a793]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x137a4af]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x136cc71]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x14d180f]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x14d0871]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x14d3fab]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x14d0871]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x14d07a1]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x142b995]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x142cc70]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x142c9a7]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x142c8b1]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x142b6de]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x142b6b4]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x63d3c9]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x63d296]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x4fd485]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x490dd8]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7fe16f476b97]
/home/xander/swift-tensorflow-RELEASE-0.11-cuda10.2-cudnn7-ubuntu18.04/usr/bin/swift-frontend[0x49098a]
[6/127] Compiling BigInt Addition.swift
[7/127] Compiling CryptoSwift AEADChaCha20Poly1305.swift
[8/128] Merging module SwiftyBase64
[8/128] Compiling c-atomics.c
[8/128] Compiling c-nioatomics.c

I am not seeing this in a handful of other libraries I am successfully building.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/swift.yml
  • actions/checkout v3
  • actions/checkout v3
  • ubuntu 18.04
swift
Package.swift
  • apple/swift-nio from: "2.59.0"
  • krzyzanowskim/CryptoSwift "1.1.3"..."1.3.2"
  • attaswift/BigInt from: "5.0.0"

  • Check this box to trigger a request for Renovate to run again on this repository

GoogleRefreshTokenProvider should refresh the token if it's expires

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Is your feature request related to a problem? Please describe.
When having a long running code, the access token will expire and will not be automatically refreshed.

Describe the solution you'd like

withToken method should check if the token expire, and if so, try to refresh it using exchange instead of always returning the token.

Describe alternatives you've considered

I have a working solution that looks like that:

private var compute: Compute {
        get async throws {
            if let tokenProvider = tokenProvider {
                
                let token: Token = try await withCheckedThrowingContinuation{ continuation in
                    do {
                        try tokenProvider.withToken{ token, error in
                            if let token = token {
                                continuation.resume(returning: token)
                            } else if let error = error {
                                continuation.resume(throwing: error)
                            }
                        }
                    } catch{
                        continuation.resume(throwing: error)
                    }
                }
                
                if let creationTime = self.tokenCreationTime, let expiresIn = token.ExpiresIn {
                    let expirationDate = creationTime.advanced(by: Double(expiresIn * 60))
                    
                    print(expirationDate)
                    print(Date().advanced(by: -(5 * 60)))
                    
                    if (expirationDate > Date().advanced(by: -(5 * 60))) {
                        self.tokenProvider = try self.tokenProviderFactory()
                        self.tokenCreationTime = Date()
                    }
                }
                
                return Compute(tokenProvider: tokenProvider)
            } else {
                let tokenProvider = try self.tokenProviderFactory()
                self.tokenProvider = tokenProvider
                self.tokenCreationTime = Date()
                return Compute(tokenProvider: tokenProvider)
            }
        }
    }

But I think this is better suited in the library itself as this is a common problem...

Compile Error in version 0.5.1 (iOS)

Xcode 11.2.1
iOS App
Used Package Manager to add version 0.5.1, I get an error when trying to compile

/Users/sroche/Library/Developer/Xcode/DerivedData/VoiceSDK-busrquwllwuizeggjkjpmbuavmoz/SourcePackages/checkouts/google-auth-library-swift/Sources/OAuth2/openURL.swift:21:14: error: use of unresolved identifier 'Process'
  let task = Process()
             ^~~~~~~

It looks like the func shell(...) should be in a #if os(OSX)

CryptoSwift Dependency issue

CryptoSwift version is pointing to 1.0.0 tag, it should be at least 1.3.2 to be able to Xcode 12.5 ..
I seen that this has already been reported on 1 June

ServiceTokens are created on each Connection.request when the unexpired may still be available in the ServiceTokenProvider

Is your feature request related to a problem? Please describe.

The latency of repeated requests (at least to Sheets API) is non-trivial, as it appears on each request a new token is requested. This likely results in extra unnecessary bandwidth consumption for devices and delays in the user experience.

Describe the solution you'd like

If the current token is unexpired, it should be returned. Additionally, if a request comes in before an imminently expiring token an asynchronous process should be kicked off to refresh it. Alternatively, upon creation of a token schedule a refresh slightly before token expiry.

Describe alternatives you've considered

See above for two possible solutions.

Additional context

I will craft a PR for one of the alternatives shortly.

Soft-warn about application default credentials using gcloud credentials

Due to user issues with quota and API enablement, the auth libraries should issue a soft warning (that can be silenced) when application default credentials uses user credentials from the Cloud SDK. They should not warn if the credentials for the cloud sdk are service account credentials.

Your application has authenticated using end user credentials from Google 
Cloud SDK. We recommend that most server applications use service accounts
 instead. If your application continues to use end user credentials from Cloud 
SDK, you might receive a "quota exceeded" or "API not enabled" error. For 
more information about service accounts, see 
https://cloud.google.com/docs/authentication/.

Additional context:
https://groups.google.com/a/google.com/forum/#!topic/client-auth-team/DKqrFw6lL1Q
https://buganizer.corp.google.com/issues/64388723
googleapis/google-auth-library-python#266

We need some tests.

Currently I'm testing new versions by manually running each of the examples against production services (Twitter, Google, GitHub, Meetup, and Spotify). But this requires credentials for each of these services, which I can't commit or use for CI.

One thing that we could do is script this to automatically call each of these services, but that still requires manual participation and can't be run in CI.

A possibly better approach would be to run a small mock server locally and authenticate against that. This wouldn't protect us against changes to the services we call (though they shouldn't be changing) but it would have caught some problems I had when upgrading to Swift NIO 2.0. The server could be built with the same TinyHTTPServer that we are using in the BrowserTokenProviders.

google-api-swift-client depends on unreleased code here

Is your feature request related to a problem? Please describe.
google-api-swift-clientmain branch depends on code that is on main here, but is not released due to the fact that no tags have been added since September 2020.

Describe the solution you'd like
The code currently on main should be tagged with either 0.5.4 or 0.6.0

Describe alternatives you've considered
google-api-swift-client could be updated to pin to main instead of to a version, but the README here states that users should "always refer to a tagged version"

Refresh does not set `CreationDate` or `RefreshToken` when decoding the refreshed token from JSON

#59 introduced the ability to refresh tokens in BrowserTokenProvider and PlatformNativeTokenProvider using the Refresh type.

If the token received in Refresh.exchange() has the content-type application/json, the CreationDate and RefreshToken are not checked before returning the new token. This creates the possiblity of returning a token with no CreationDate or RefreshToken, which can make subsequent auth flows challenging. These properties are checked and explicitly set (if necessary) when the content-type is application/x-www-form-urlencoded.

Proposed Solution:

Refresh should follow the same logic for checking and setting these values in both cases.

Enable master branch protection

      This repository does not seem to have master branch
      protection enabled, at least in the way I'm expecting.
      I was hoping for:

      - master branch protection
      - requiring at least one code reviewer
      - requiring at least two status checks
      - enforcing rules for admins

      Please turn it on!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.