Skip to content

Commit 0a2a1ab

Browse files
authored
CSHARP-5315: Mark API as obsolete: Auth (#1486)
1 parent ca12a03 commit 0a2a1ab

26 files changed

+62
-4
lines changed

src/MongoDB.Driver.Core/Core/Authentication/AuthenticationHelper.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ namespace MongoDB.Driver.Core.Authentication
2929
{
3030
internal static class AuthenticationHelper
3131
{
32+
#pragma warning disable CS0618 // Type or member is obsolete
3233
public static void Authenticate(IConnection connection, ConnectionDescription description, IReadOnlyList<IAuthenticator> authenticators, CancellationToken cancellationToken)
34+
#pragma warning restore CS0618 // Type or member is obsolete
3335
{
3436
Ensure.IsNotNull(connection, nameof(connection));
3537
Ensure.IsNotNull(description, nameof(description));
@@ -45,7 +47,9 @@ public static void Authenticate(IConnection connection, ConnectionDescription de
4547
}
4648
}
4749

50+
#pragma warning disable CS0618 // Type or member is obsolete
4851
public static async Task AuthenticateAsync(IConnection connection, ConnectionDescription description, IReadOnlyList<IAuthenticator> authenticators, CancellationToken cancellationToken)
52+
#pragma warning restore CS0618 // Type or member is obsolete
4953
{
5054
Ensure.IsNotNull(connection, nameof(connection));
5155
Ensure.IsNotNull(description, nameof(description));

src/MongoDB.Driver.Core/Core/Authentication/AuthenticatorFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ namespace MongoDB.Driver.Core.Authentication
2121
/// <summary>
2222
/// Represents an authenticator factory.
2323
/// </summary>
24+
[Obsolete("This class will be made internal in a later release.")]
2425
public class AuthenticatorFactory : IAuthenticatorFactory
2526
{
2627
private readonly Func<IAuthenticator> _authenticatorFactoryFunc;

src/MongoDB.Driver.Core/Core/Authentication/DefaultAuthenticator.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace MongoDB.Driver.Core.Authentication
2929
/// Else, uses SCRAM-SHA-256 if present in the list of mechanisms. Otherwise, uses
3030
/// SCRAM-SHA-1 the default, regardless of whether SCRAM-SHA-1 is in the list.
3131
/// </summary>
32+
[Obsolete("This class will be made internal in a later release.")]
3233
public class DefaultAuthenticator : IAuthenticator
3334
{
3435
// fields

src/MongoDB.Driver.Core/Core/Authentication/GssapiAuthenticator.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace MongoDB.Driver.Core.Authentication
2828
/// <summary>
2929
/// A GSSAPI SASL authenticator.
3030
/// </summary>
31+
[Obsolete("This class will be made internal in a later release.")]
3132
public sealed class GssapiAuthenticator : SaslAuthenticator
3233
{
3334
// constants

src/MongoDB.Driver.Core/Core/Authentication/IAuthenticator.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* limitations under the License.
1414
*/
1515

16+
using System;
1617
using System.Threading;
1718
using System.Threading.Tasks;
1819
using MongoDB.Bson;
@@ -23,6 +24,7 @@ namespace MongoDB.Driver.Core.Authentication
2324
/// <summary>
2425
/// Represents a connection authenticator.
2526
/// </summary>
27+
[Obsolete("This interface will be made internal in a later release.")]
2628
public interface IAuthenticator
2729
{
2830
/// <summary>

src/MongoDB.Driver.Core/Core/Authentication/IAuthenticatorFactory.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
* limitations under the License.
1414
*/
1515

16+
using System;
17+
1618
namespace MongoDB.Driver.Core.Authentication
1719
{
1820
/// <summary>
1921
/// Represents an authenticator factory.
2022
/// </summary>
23+
[Obsolete("This interface will be made internal in a later release.")]
2124
public interface IAuthenticatorFactory
2225
{
2326
/// <summary>

src/MongoDB.Driver.Core/Core/Authentication/MongoAWSAuthenticator.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ namespace MongoDB.Driver.Core.Authentication
3030
/// <summary>
3131
/// The Mongo AWS authenticator.
3232
/// </summary>
33+
[Obsolete("This class will be made internal in a later release.")]
3334
public class MongoAWSAuthenticator : SaslAuthenticator
3435
{
3536
// constants

src/MongoDB.Driver.Core/Core/Authentication/MongoDBX509Authenticator.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ namespace MongoDB.Driver.Core.Authentication
2727
/// <summary>
2828
/// A MongoDB-X509 authenticator.
2929
/// </summary>
30+
[Obsolete("This class will be made internal in a later release.")]
3031
public sealed class MongoDBX509Authenticator : IAuthenticator
3132
{
3233
// static properties

src/MongoDB.Driver.Core/Core/Authentication/NoTransitionClientLastSaslStep.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ namespace MongoDB.Driver.Core.Authentication
2222
/// <summary>
2323
/// Represents a last SASL step.
2424
/// </summary>
25+
#pragma warning disable CS0618 // Type or member is obsolete
2526
internal sealed class NoTransitionClientLastSaslStep : SaslAuthenticator.ISaslStep
27+
#pragma warning restore CS0618 // Type or member is obsolete
2628
{
2729
private readonly byte[] _bytesToSendToServer;
2830

@@ -41,6 +43,7 @@ public NoTransitionClientLastSaslStep(byte[] bytesToSendToServer)
4143
public bool IsComplete => false;
4244

4345
/// <inheritdoc/>
46+
#pragma warning disable CS0618 // Type or member is obsolete
4447
public SaslAuthenticator.ISaslStep Transition(SaslAuthenticator.SaslConversation conversation, byte[] bytesReceivedFromServer)
4548
{
4649
if (bytesReceivedFromServer?.Length > 0)
@@ -54,5 +57,6 @@ public SaslAuthenticator.ISaslStep Transition(SaslAuthenticator.SaslConversation
5457

5558
public Task<SaslAuthenticator.ISaslStep> TransitionAsync(SaslAuthenticator.SaslConversation conversation, byte[] bytesReceivedFromServer, CancellationToken cancellationToken)
5659
=> Task.FromResult(Transition(conversation, bytesReceivedFromServer));
60+
#pragma warning restore CS0618 // Type or member is obsolete
5761
}
5862
}

src/MongoDB.Driver.Core/Core/Authentication/Oidc/MongoOidcAuthenticator.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424

2525
namespace MongoDB.Driver.Core.Authentication.Oidc
2626
{
27+
#pragma warning disable CS0618 // Type or member is obsolete
2728
internal sealed class MongoOidcAuthenticator : SaslAuthenticator
29+
#pragma warning restore CS0618 // Type or member is obsolete
2830
{
2931
#region static
3032
public const string MechanismName = "MONGODB-OIDC";

0 commit comments

Comments
 (0)