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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using InvalidCredentialException = Couchbase.AnalyticsClient.Exceptions.InvalidCredentialException;
using QueryException = Couchbase.AnalyticsClient.Exceptions.QueryException;


namespace Couchbase.Analytics.Performer.Internal.Utils;

internal static class ExceptionExtensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
* ************************************************************/
#endregion

using System.Net.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Net.Security;
using Couchbase.AnalyticsClient.Options;
using Microsoft.Extensions.Logging;

Expand Down Expand Up @@ -210,16 +210,16 @@
}
else if (securityOptions.TrustMode == CertificateTrustMode.PemFilePath)
{
trustedCertificates.Add(new X509Certificate2(securityOptions.PathToPemFileValue));

Check warning on line 213 in src/Couchbase.Analytics/Certificates/CertificateValidation.cs

View workflow job for this annotation

GitHub Actions / Build and Unit Tests (ubuntu-latest)

Possible null reference argument for parameter 'fileName' in 'X509Certificate2.X509Certificate2(string fileName)'.

Check warning on line 213 in src/Couchbase.Analytics/Certificates/CertificateValidation.cs

View workflow job for this annotation

GitHub Actions / Build and Unit Tests (windows-latest)

Possible null reference argument for parameter 'fileName' in 'X509Certificate2.X509Certificate2(string fileName)'.
}
else if (securityOptions.TrustMode == CertificateTrustMode.PemString)
{
trustedCertificates.Add(new X509Certificate2(
rawData: System.Text.Encoding.ASCII.GetBytes(securityOptions.CertificateValue)));

Check warning on line 218 in src/Couchbase.Analytics/Certificates/CertificateValidation.cs

View workflow job for this annotation

GitHub Actions / Build and Unit Tests (ubuntu-latest)

Possible null reference argument for parameter 's' in 'byte[] Encoding.GetBytes(string s)'.

Check warning on line 218 in src/Couchbase.Analytics/Certificates/CertificateValidation.cs

View workflow job for this annotation

GitHub Actions / Build and Unit Tests (windows-latest)

Possible null reference argument for parameter 's' in 'byte[] Encoding.GetBytes(string s)'.
}
else if (securityOptions.TrustMode == CertificateTrustMode.CertificatesOnly)
{
trustedCertificates.AddRange(securityOptions.CertificatesValue);

Check warning on line 222 in src/Couchbase.Analytics/Certificates/CertificateValidation.cs

View workflow job for this annotation

GitHub Actions / Build and Unit Tests (ubuntu-latest)

Possible null reference argument for parameter 'certificates' in 'void X509Certificate2Collection.AddRange(X509Certificate2Collection certificates)'.

Check warning on line 222 in src/Couchbase.Analytics/Certificates/CertificateValidation.cs

View workflow job for this annotation

GitHub Actions / Build and Unit Tests (windows-latest)

Possible null reference argument for parameter 'certificates' in 'void X509Certificate2Collection.AddRange(X509Certificate2Collection certificates)'.
}

LogBuiltCustomTrustCollection(logger, trustedCertificates.Count);
Expand Down
3 changes: 2 additions & 1 deletion src/Couchbase.Analytics/Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
#endregion

using System.Collections.Concurrent;
using Couchbase.AnalyticsClient.DI;
using Couchbase.AnalyticsClient.HTTP;
using Couchbase.AnalyticsClient.Internal;
using Couchbase.AnalyticsClient.Internal.DI;
using Couchbase.AnalyticsClient.Options;
using Couchbase.AnalyticsClient.Results;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -104,7 +105,7 @@
/// <returns>A Cluster instance</returns>
/// <exception cref="ArgumentException">Thrown when the connection string is null or empty, or the credential is null</exception>
public static Cluster Create(string connectionString, Credential credential){
return Create(connectionString, credential, (ClusterOptions?)null);

Check warning on line 108 in src/Couchbase.Analytics/Cluster.cs

View workflow job for this annotation

GitHub Actions / Build and Unit Tests (ubuntu-latest)

Cannot convert null literal to non-nullable reference type.

Check warning on line 108 in src/Couchbase.Analytics/Cluster.cs

View workflow job for this annotation

GitHub Actions / Build and Unit Tests (windows-latest)

Cannot convert null literal to non-nullable reference type.
}

/// <summary>
Expand Down
9 changes: 9 additions & 0 deletions src/Couchbase.Analytics/Couchbase.Analytics.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
<ItemGroup>
<ProjectReference Include="..\Couchbase.Text.Json\Couchbase.Text.Json.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Internal\Certificates\" />
<Folder Include="Internal\Exceptions\" />
<Folder Include="Internal\Options\" />
<Folder Include="Internal\Query\" />
<Folder Include="Public\" />
<Folder Include="Retry\" />
</ItemGroup>


</Project>
3 changes: 1 addition & 2 deletions src/Couchbase.Analytics/Exceptions/AnalyticsException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

using System.Runtime.Serialization;
using System.Text;
using System.Text.Json;
using Couchbase.AnalyticsClient.Retry;
using Couchbase.AnalyticsClient.Internal.Retry;

namespace Couchbase.AnalyticsClient.Exceptions;

Expand All @@ -37,7 +36,7 @@
{
}

protected AnalyticsException(SerializationInfo info, StreamingContext context) : base(info, context)

Check warning on line 39 in src/Couchbase.Analytics/Exceptions/AnalyticsException.cs

View workflow job for this annotation

GitHub Actions / Build and Unit Tests (ubuntu-latest)

'Exception.Exception(SerializationInfo, StreamingContext)' is obsolete: 'This API supports obsolete formatter-based serialization. It should not be called or extended by application code.' (https://aka.ms/dotnet-warnings/SYSLIB0051)

Check warning on line 39 in src/Couchbase.Analytics/Exceptions/AnalyticsException.cs

View workflow job for this annotation

GitHub Actions / Build and Unit Tests (windows-latest)

'Exception.Exception(SerializationInfo, StreamingContext)' is obsolete: 'This API supports obsolete formatter-based serialization. It should not be called or extended by application code.' (https://aka.ms/dotnet-warnings/SYSLIB0051)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#endregion

using System.Runtime.Serialization;
using Couchbase.AnalyticsClient.Retry;
using Couchbase.AnalyticsClient.Internal.Retry;

namespace Couchbase.AnalyticsClient.Exceptions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
#endregion

using System.Runtime.Serialization;
using System.Text.Json;
using Couchbase.AnalyticsClient.Retry;
using Couchbase.AnalyticsClient.Internal.Retry;

namespace Couchbase.AnalyticsClient.Exceptions;

Expand Down
2 changes: 1 addition & 1 deletion src/Couchbase.Analytics/Exceptions/QueryException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#endregion

using System.Runtime.Serialization;
using Couchbase.AnalyticsClient.Retry;
using Couchbase.AnalyticsClient.Internal.Retry;

namespace Couchbase.AnalyticsClient.Exceptions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@
using System.Text;
using Couchbase.AnalyticsClient.Exceptions;
using Couchbase.AnalyticsClient.HTTP;
using Couchbase.AnalyticsClient.Internal.HTTP;
using Couchbase.AnalyticsClient.Internal.Results;
using Couchbase.AnalyticsClient.Internal.Retry;
using Couchbase.AnalyticsClient.Options;
using Couchbase.AnalyticsClient.Results;
using Couchbase.AnalyticsClient.Retry;
using Couchbase.Text.Json;
using Couchbase.Text.Json.Utils;
using Microsoft.Extensions.Logging;

namespace Couchbase.AnalyticsClient;
namespace Couchbase.AnalyticsClient.Internal;

internal sealed class AnalyticsService : HttpServiceBase, IAnalyticsService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@

using System.Text;
using System.Text.RegularExpressions;
using Couchbase.AnalyticsClient.Internal.Utils;
using Couchbase.AnalyticsClient.Utils;

namespace Couchbase.AnalyticsClient;
namespace Couchbase.AnalyticsClient.Internal;

internal class ConnectionString
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Reflection;

namespace Couchbase.AnalyticsClient.DI;
namespace Couchbase.AnalyticsClient.Internal.DI;

internal static class ConstructorSelector
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

using System.Collections.ObjectModel;

namespace Couchbase.AnalyticsClient.DI;
namespace Couchbase.AnalyticsClient.Internal.DI;

internal sealed class CouchbaseServiceProvider : ICouchbaseServiceProvider
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

using Couchbase.AnalyticsClient.Utils;

namespace Couchbase.AnalyticsClient.DI;
namespace Couchbase.AnalyticsClient.Internal.DI;

/// <summary>
/// Extensions for <seealso cref="IServiceProvider"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
#endregion

using System.Text.Json;
using Couchbase.AnalyticsClient.HTTP;
using Couchbase.AnalyticsClient.Internal.HTTP;
using Couchbase.Text.Json;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;

namespace Couchbase.AnalyticsClient.DI;
namespace Couchbase.AnalyticsClient.Internal.DI;

internal static class DefaultServices
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* ************************************************************/
#endregion

namespace Couchbase.AnalyticsClient.DI;
namespace Couchbase.AnalyticsClient.Internal.DI;

/// <summary>
/// Extends <see cref="IServiceProvider"/> with a method to test for service registration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* ************************************************************/
#endregion

namespace Couchbase.AnalyticsClient.DI;
namespace Couchbase.AnalyticsClient.Internal.DI;

/// <summary>
/// A factory capable of returning a service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using System.Diagnostics.CodeAnalysis;
using Couchbase.AnalyticsClient.Exceptions;

namespace Couchbase.AnalyticsClient.DI;
namespace Couchbase.AnalyticsClient.Internal.DI;

/// <summary>
/// References a singleton of a service that isn't instantiated until required.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* ************************************************************/
#endregion

namespace Couchbase.AnalyticsClient.DI;
namespace Couchbase.AnalyticsClient.Internal.DI;

/// <summary>
/// Marks a public constructor as preferred for selection by service factories. If applied, the
Expand All @@ -28,6 +28,6 @@ namespace Couchbase.AnalyticsClient.DI;
/// attribute.
/// </summary>
[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
public sealed class PreferredConstructorAttribute : Attribute
internal sealed class PreferredConstructorAttribute : Attribute
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
using System.Diagnostics.CodeAnalysis;
using Couchbase.AnalyticsClient.Utils;

namespace Couchbase.AnalyticsClient.DI;
namespace Couchbase.AnalyticsClient.Internal.DI;

/// <summary>
/// Implementation of <see cref="IServiceFactory"/> which constructs more specific types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using System.Diagnostics.CodeAnalysis;
using Couchbase.AnalyticsClient.Utils;

namespace Couchbase.AnalyticsClient.DI;
namespace Couchbase.AnalyticsClient.Internal.DI;

internal sealed class SingletonServiceFactory : IServiceFactory
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using System.Diagnostics.CodeAnalysis;
using Couchbase.AnalyticsClient.Utils;

namespace Couchbase.AnalyticsClient.DI;
namespace Couchbase.AnalyticsClient.Internal.DI;

/// <summary>
/// Implementation of <see cref="IServiceFactory"/> which creates a transient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@

using System.Net;
using System.Net.Sockets;
using Couchbase.AnalyticsClient.DnsUtil.Strategies;
using Couchbase.AnalyticsClient.DnsUtil;
using Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies;

namespace Couchbase.AnalyticsClient.DnsUtil;
namespace Couchbase.AnalyticsClient.Internal.DnsUtil;

/// <summary>
/// Adapted from https://github.com/MihaZupan/DnsRoundRobin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
#endregion

using System.Net;
using Couchbase.AnalyticsClient.DnsUtil.Strategies;
using Couchbase.AnalyticsClient.DnsUtil;
using Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies;

namespace Couchbase.AnalyticsClient.DnsUtil;
namespace Couchbase.AnalyticsClient.Internal.DnsUtil;

internal class DnsEndpointResolver : IDnsEndpointResolver
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

using System.Net;
using System.Net.Sockets;
using Couchbase.AnalyticsClient.DnsUtil.Strategies;
using Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;

namespace Couchbase.AnalyticsClient.DnsUtil;
namespace Couchbase.AnalyticsClient.Internal.DnsUtil;

internal class EndpointConnectionManager
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* ************************************************************/
#endregion

namespace Couchbase.AnalyticsClient.DnsUtil;
namespace Couchbase.AnalyticsClient.Internal.DnsUtil;

internal enum EndpointSelectionMode
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* ************************************************************/
#endregion

namespace Couchbase.AnalyticsClient.DnsUtil.Strategies;
namespace Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies;

internal class CountBasedDnsRefreshStrategy : IDnsRefreshStrategy
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* ************************************************************/
#endregion

namespace Couchbase.AnalyticsClient.DnsUtil.Strategies;
namespace Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies;

internal interface IDnsRefreshStrategy
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

using System.Net;

namespace Couchbase.AnalyticsClient.DnsUtil.Strategies;
namespace Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies;

internal interface IEndpointSelectionStrategy
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

using System.Net;

namespace Couchbase.AnalyticsClient.DnsUtil.Strategies;
namespace Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies;

internal class RandomEndpointSelector : IEndpointSelectionStrategy
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

using System.Net;

namespace Couchbase.AnalyticsClient.DnsUtil.Strategies;
namespace Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies;

internal class RoundRobinEndpointSelector : IEndpointSelectionStrategy
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

using System.Diagnostics;

namespace Couchbase.AnalyticsClient.DnsUtil.Strategies;
namespace Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies;

internal class TimeBasedDnsRefreshStrategy : IDnsRefreshStrategy
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@

using System.Net.Http.Headers;
using System.Text;
using Couchbase.AnalyticsClient.HTTP;

namespace Couchbase.AnalyticsClient.HTTP;
namespace Couchbase.AnalyticsClient.Internal.HTTP;

internal class AuthenticationHandler : DelegatingHandler
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
using System.Net.Sockets;
using System.Security.Cryptography.X509Certificates;
using Couchbase.AnalyticsClient.Certificates;
using Couchbase.AnalyticsClient.DnsUtil;
using Couchbase.AnalyticsClient.DnsUtil.Strategies;
using Couchbase.AnalyticsClient.HTTP;
using Couchbase.AnalyticsClient.Internal.DnsUtil;
using Couchbase.AnalyticsClient.Internal.DnsUtil.Strategies;
using Couchbase.AnalyticsClient.Internal.Utils;
using Couchbase.AnalyticsClient.Options;
using Couchbase.AnalyticsClient.Utils;
using Microsoft.Extensions.Logging;

namespace Couchbase.AnalyticsClient.HTTP;
namespace Couchbase.AnalyticsClient.Internal.HTTP;

internal class CouchbaseHttpClientFactory : ICouchbaseHttpClientFactory
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
* ************************************************************/
#endregion

using Couchbase.AnalyticsClient.Utils;
using Couchbase.AnalyticsClient.Internal.Utils;

namespace Couchbase.AnalyticsClient.HTTP;
namespace Couchbase.AnalyticsClient.Internal.HTTP;

/// <summary>
/// Base class for HTTP services to inherit from to provide consistent access to clusterOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* ************************************************************/
#endregion

namespace Couchbase.AnalyticsClient.HTTP;
namespace Couchbase.AnalyticsClient.Internal.HTTP;

/// <summary>
/// Creates an <see cref="HttpClient"/> which may be safely configured and disposed, but while
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using Couchbase.AnalyticsClient.Options;
using Couchbase.AnalyticsClient.Results;

namespace Couchbase.AnalyticsClient;
namespace Couchbase.AnalyticsClient.Internal;

internal interface IAnalyticsService
{
Expand Down
Loading
Loading