-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Change default for UseSelfSignedJwtsWithScopes in REST to false
This addresses a backward compatibility issue when an existing client library is used with an updated version of GAX. (There's no opportunity for the client library to change the default in that case.)
- Loading branch information
Showing
3 changed files
with
46 additions
and
13 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
Google.Api.Gax.Rest.Tests/ClientBuilderBaseTest.Defaults.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 2022 Google Inc. All Rights Reserved. | ||
* Use of this source code is governed by a BSD-style | ||
* license that can be found in the LICENSE file or at | ||
* https://developers.google.com/open-source/licenses/bsd | ||
*/ | ||
|
||
using System.Threading.Tasks; | ||
using System.Threading; | ||
using System; | ||
using Xunit; | ||
|
||
namespace Google.Api.Gax.Rest.Tests; | ||
|
||
public partial class ClientBuilderBaseTest | ||
{ | ||
[Fact] | ||
public void UseSelfSignedJwts_DisabledByDefault() | ||
{ | ||
var builder = new DefaultsTestBuilder(); | ||
Assert.False(builder.UseJwtAccessWithScopes); | ||
} | ||
|
||
/// <summary> | ||
/// Builder with no custom behavior, which purely exists to check defaults. | ||
/// </summary> | ||
private class DefaultsTestBuilder : ClientBuilderBase<string> | ||
{ | ||
public override string Build() => | ||
throw new NotImplementedException(); | ||
|
||
public override Task<string> BuildAsync(CancellationToken cancellationToken = default) => | ||
throw new NotImplementedException(); | ||
|
||
protected override string GetDefaultApplicationName() => | ||
throw new NotImplementedException(); | ||
|
||
protected override ScopedCredentialProvider GetScopedCredentialProvider() => | ||
throw new NotImplementedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters