Skip to content

Commit df05218

Browse files
author
Daniel Jacinto
authored
Merge pull request #9045 from NuGet/dev
[ReleasePrep][2022.03.10]RI of dev into main
2 parents ba69320 + b2cb381 commit df05218

21 files changed

Lines changed: 390 additions & 50 deletions

File tree

src/AccountDeleter/EmptyFeatureFlagService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ public bool IsMarkdigMdRenderingEnabled()
141141
throw new NotImplementedException();
142142
}
143143

144+
public bool IsNewAccount2FAEnforcementEnabled()
145+
{
146+
throw new NotImplementedException();
147+
}
148+
144149
public bool IsODataDatabaseReadOnlyEnabled()
145150
{
146151
throw new NotImplementedException();

src/Bootstrap/dist/css/bootstrap-theme.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bootstrap/dist/css/bootstrap.css

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bootstrap/less/mixins/buttons.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
&:focus,
1212
&.focus {
1313
color: @color;
14-
background-color: darken(@background, 10%);
1514
border-color: darken(@border, 25%);
1615
}
1716
&:hover {

src/Bootstrap/less/navbar.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
@media (min-width: @grid-float-breakpoint) {
2222
border-radius: @navbar-border-radius;
2323
}
24+
25+
a:focus {
26+
outline: 4px solid white;
27+
outline-offset: -2px;
28+
}
2429
}
2530

2631

src/Bootstrap/less/theme/base.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ body {
8383

8484
a {
8585
color: @panel-footer-color;
86+
87+
&:focus {
88+
outline: 3px solid white;
89+
outline-offset: 2px;
90+
}
8691
}
8792

8893
.footer-release-info {

src/GitHubVulnerabilities2Db/Fakes/FakeFeatureFlagService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,5 +274,10 @@ public bool IsRecentPackagesNoIndexEnabled()
274274
{
275275
throw new NotImplementedException();
276276
}
277+
278+
public bool IsNewAccount2FAEnforcementEnabled()
279+
{
280+
throw new NotImplementedException();
281+
}
277282
}
278283
}

src/NuGetGallery.Services/Authentication/AuthenticationService.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ private async Task<Claim[]> GetUserLoginClaims(AuthenticatedUser user, bool wasM
345345
.Where(cred => cred.IsExternal())
346346
.Select(cred => cred.Identity)
347347
.ToArray();
348-
348+
349349
var identityList = string.Join(" or ", externalIdentities);
350350
ClaimsExtensions.AddExternalCredentialIdentityClaim(claims, identityList);
351351
}
@@ -365,7 +365,7 @@ private async Task<Claim[]> GetUserLoginClaims(AuthenticatedUser user, bool wasM
365365
return claims.ToArray();
366366
}
367367

368-
public virtual async Task<AuthenticatedUser> Register(string username, string emailAddress, Credential credential, bool autoConfirm = false)
368+
public virtual async Task<AuthenticatedUser> Register(string username, string emailAddress, Credential credential, bool autoConfirm = false, bool enableMultiFactorAuthentication = false)
369369
{
370370
if (_config.FeedOnlyMode)
371371
{
@@ -392,7 +392,8 @@ public virtual async Task<AuthenticatedUser> Register(string username, string em
392392
UnconfirmedEmailAddress = emailAddress,
393393
EmailConfirmationToken = CryptographyService.GenerateToken(),
394394
NotifyPackagePushed = true,
395-
CreatedUtc = _dateTimeProvider.UtcNow
395+
CreatedUtc = _dateTimeProvider.UtcNow,
396+
EnableMultiFactorAuthentication = enableMultiFactorAuthentication
396397
};
397398

398399
// Add a credential for the password
@@ -799,15 +800,15 @@ private async Task ReplaceCredentialInternal(User user, Credential credential)
799800
Func<Credential, bool> replacingPredicate;
800801
if (!string.IsNullOrEmpty(replaceCredPrefix))
801802
{
802-
replacingPredicate = cred => cred.Type.StartsWith(replaceCredPrefix, StringComparison.OrdinalIgnoreCase);
803+
replacingPredicate = cred => cred.Type.StartsWith(replaceCredPrefix, StringComparison.OrdinalIgnoreCase);
803804
}
804805
else
805806
{
806807
replacingPredicate = cred => cred.Type.Equals(credential.Type, StringComparison.OrdinalIgnoreCase);
807808
}
808809

809810
var toRemove = user.Credentials
810-
.Where(replacingPredicate)
811+
.Where(replacingPredicate)
811812
.ToList();
812813

813814
foreach (var cred in toRemove)

src/NuGetGallery.Services/Configuration/FeatureFlagService.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public class FeatureFlagService : IFeatureFlagService
5353
private const string DisplayTargetFrameworkFeatureName = GalleryPrefix + "DisplayTargetFramework";
5454
private const string ComputeTargetFrameworkFeatureName = GalleryPrefix + "ComputeTargetFramework";
5555
private const string RecentPackagesNoIndexFeatureName = GalleryPrefix + "RecentPackagesNoIndex";
56+
private const string NewAccount2FAEnforcementFeatureName = GalleryPrefix + "NewAccount2FAEnforcement";
5657

5758
private const string ODataV1GetAllNonHijackedFeatureName = GalleryPrefix + "ODataV1GetAllNonHijacked";
5859
private const string ODataV1GetAllCountNonHijackedFeatureName = GalleryPrefix + "ODataV1GetAllCountNonHijacked";
@@ -362,5 +363,10 @@ public bool IsRecentPackagesNoIndexEnabled()
362363
{
363364
return _client.IsEnabled(RecentPackagesNoIndexFeatureName, defaultValue: false);
364365
}
366+
367+
public bool IsNewAccount2FAEnforcementEnabled()
368+
{
369+
return _client.IsEnabled(NewAccount2FAEnforcementFeatureName, defaultValue: false);
370+
}
365371
}
366372
}

src/NuGetGallery.Services/Configuration/IFeatureFlagService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,10 @@ public interface IFeatureFlagService
291291
/// Whether or not recent packages has no index applied to block search engine indexing.
292292
/// </summary>
293293
bool IsRecentPackagesNoIndexEnabled();
294+
295+
/// <summary>
296+
/// Whether or not to enforce 2FA for new external account link or replacement.
297+
/// </summary>
298+
bool IsNewAccount2FAEnforcementEnabled();
294299
}
295300
}

0 commit comments

Comments
 (0)