57 references to IdentitySource
aspire (36)
Acquisition\IdentityResolver.cs (28)
121return new IdentityValue<string>(env, IdentitySource.Environment); 127return new IdentityValue<string>(sidecarValue, IdentitySource.Sidecar); 135return new IdentityValue<string>(assemblyValue, IdentitySource.AssemblyFallback); 138return new IdentityValue<string>(PackageChannelNames.Local, IdentitySource.TerminalDefault); 145ValidateVersion(env, IdentitySource.Environment); 146return new IdentityValue<string>(env, IdentitySource.Environment); 152ValidateVersion(sidecarValue, IdentitySource.Sidecar); 153return new IdentityValue<string>(sidecarValue, IdentitySource.Sidecar); 156return new IdentityValue<string>(assemblyVersionAndCommit.Version, IdentitySource.AssemblyFallback); 163ValidateCommit(env, IdentitySource.Environment); 164return new IdentityValue<string>(env, IdentitySource.Environment); 170ValidateCommit(sidecarValue, IdentitySource.Sidecar); 171return new IdentityValue<string>(sidecarValue, IdentitySource.Sidecar); 174return new IdentityValue<string>(assemblyVersionAndCommit.Commit, IdentitySource.AssemblyFallback); 181ValidateNuGetServiceIndex(env, IdentitySource.Environment); 182return new IdentityValue<string?>(env, IdentitySource.Environment); 188ValidateNuGetServiceIndex(sidecarValue, IdentitySource.Sidecar); 189return new IdentityValue<string?>(sidecarValue, IdentitySource.Sidecar); 194return new IdentityValue<string?>(null, IdentitySource.TerminalDefault); 201return new IdentityValue<string?>(env, IdentitySource.Environment); 207return new IdentityValue<string?>(sidecarValue, IdentitySource.Sidecar); 213return new IdentityValue<string?>(null, IdentitySource.TerminalDefault); 226private static void ValidateVersion(string value, IdentitySource source) 239private static void ValidateCommit(string value, IdentitySource source) 256private static void ValidateNuGetServiceIndex(string value, IdentitySource source) 287private static string BuildInvalidOverrideMessage(IdentitySource source, string envVar, string sidecarField, string value, string expected) 293IdentitySource.Environment => $"environment variable {envVar}", 294IdentitySource.Sidecar => $"'{sidecarField}' field in {InstallSidecarReader.SidecarFileName}",
Acquisition\IdentityValue.cs (1)
11internal readonly record struct IdentityValue<T>(T Value, IdentitySource Source);
Program.cs (7)
716static bool IsOverride(IdentitySource source) => source is IdentitySource.Environment or IdentitySource.Sidecar; 722static bool IsEnvironmentOverride(IdentitySource source) => source is IdentitySource.Environment; 723static bool IsDeveloperSidecarOverride(IdentitySource source) => source is IdentitySource.Sidecar;
Aspire.Cli.Tests (21)
Acquisition\IdentityResolverTests.cs (21)
35Assert.Equal(IdentitySource.Environment, resolved.Source); 48Assert.Equal(IdentitySource.Sidecar, resolved.Source); 61Assert.Equal(IdentitySource.AssemblyFallback, resolved.Source); 75Assert.Equal(IdentitySource.TerminalDefault, resolved.Source); 93Assert.Equal(IdentitySource.Sidecar, resolved.Source); 105Assert.Equal(IdentitySource.AssemblyFallback, version.Source); 107Assert.Equal(IdentitySource.AssemblyFallback, commit.Source); 129Assert.Equal(IdentitySource.Environment, resolved.Source); 144Assert.Equal(IdentitySource.Environment, resolved.Source); 190Assert.Equal(IdentitySource.Environment, resolved.Source); 219Assert.Equal(IdentitySource.Environment, resolved.Source); 250Assert.Equal(IdentitySource.Environment, resolved.Source); 263Assert.Equal(IdentitySource.TerminalDefault, resolved.Source); 278Assert.Equal(IdentitySource.Environment, resolved.Source); 291Assert.Equal(IdentitySource.Sidecar, resolved.Source); 304Assert.Equal(IdentitySource.TerminalDefault, resolved.Source); 319Assert.Equal(IdentitySource.Environment, resolved.Source); 332Assert.Equal(IdentitySource.Sidecar, resolved.Source); 395inputSource is IdentityInputSource.Sidecar ? IdentitySource.Sidecar : IdentitySource.Environment, 543private static IdentitySource GetResolvedSource(IIdentityResolver resolver, IdentityField field)