Skip to content
Merged
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
7 changes: 6 additions & 1 deletion src/TickerQ.Dashboard/Authentication/AuthService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
return AuthResult.Success("anonymous");
}

// Authentication performed by host application
if (_config.Mode == AuthMode.Host)
{
return AuthenticateHostAsync(context);

Check failure on line 38 in src/TickerQ.Dashboard/Authentication/AuthService.cs

View workflow job for this annotation

GitHub Actions / PR Build and Test

Since this is an async method, the return expression must be of type 'AuthResult' rather than 'Task<AuthResult>'

Check failure on line 38 in src/TickerQ.Dashboard/Authentication/AuthService.cs

View workflow job for this annotation

GitHub Actions / PR Build and Test

Since this is an async method, the return expression must be of type 'AuthResult' rather than 'Task<AuthResult>'
}

// Get authorization header or query parameter
var authHeader = GetAuthorizationValue(context);
if (string.IsNullOrEmpty(authHeader))
Expand All @@ -45,7 +51,6 @@
AuthMode.Basic => await AuthenticateBasicAsync(authHeader),
AuthMode.ApiKey => await AuthenticateApiKeyAsync(authHeader),
AuthMode.Custom => await AuthenticateCustomAsync(authHeader),
AuthMode.Host => await AuthenticateHostAsync(context),
_ => AuthResult.Failure("Invalid authentication mode")
};
}
Expand All @@ -66,7 +71,7 @@
};
}

private string? GetAuthorizationValue(HttpContext context)

Check warning on line 74 in src/TickerQ.Dashboard/Authentication/AuthService.cs

View workflow job for this annotation

GitHub Actions / PR Build and Test

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
// Try Authorization header first
var authHeader = context.Request.Headers.Authorization.FirstOrDefault();
Expand Down
Loading