Proxy
This commit is contained in:
@@ -33,6 +33,16 @@
|
||||
"ApplicationStorage": {
|
||||
"Bucket": "webapi-storage"
|
||||
},
|
||||
"StreamGateway": {
|
||||
"PublicBaseUrl": "http://localhost:8081",
|
||||
"ManifestFileName": "manifest.mpd"
|
||||
},
|
||||
"StreamTicket": {
|
||||
"PrivateKeyPath": "D:\\weed\\stream_private.pem",
|
||||
"Audience": "media-gateway",
|
||||
"Issuer": "musify-webapi",
|
||||
"TicketTtlSeconds": 3600
|
||||
},
|
||||
"OpenTelemetry": {
|
||||
"OtlpEndpoint": "http://localhost:4317"
|
||||
},
|
||||
|
||||
@@ -34,6 +34,16 @@
|
||||
"ApplicationStorage": {
|
||||
"Bucket": ""
|
||||
},
|
||||
"StreamGateway": {
|
||||
"PublicBaseUrl": "",
|
||||
"ManifestFileName": "manifest.mpd"
|
||||
},
|
||||
"StreamTicket": {
|
||||
"PrivateKeyPath": "",
|
||||
"Audience": "media-gateway",
|
||||
"Issuer": "musify-webapi",
|
||||
"TicketTtlSeconds": 3600
|
||||
},
|
||||
"OpenTelemetry": {
|
||||
"OtlpEndpoint": ""
|
||||
},
|
||||
|
||||
@@ -23,6 +23,11 @@ public static class TrackEndpoints
|
||||
.WithName("GetTrackById")
|
||||
.WithSummary("Get A Track By Id.");
|
||||
|
||||
group.MapGet("/{id}/stream", GetTrackStream)
|
||||
.WithName("GetTrackStream")
|
||||
.WithSummary("Get A Streaming Manifest URL And Ticket For A Track.")
|
||||
.RequireAuthorization();
|
||||
|
||||
group.MapGet("/users/{userId}", GetTracksByUserId)
|
||||
.WithName("GetTracksByUserId")
|
||||
.WithSummary("Get Paginated Tracks For A User.");
|
||||
@@ -66,6 +71,16 @@ public static class TrackEndpoints
|
||||
return result.ToHttpResult();
|
||||
}
|
||||
|
||||
private static async Task<IResult> GetTrackStream(
|
||||
IMediator mediator,
|
||||
CurrentUser currentUser,
|
||||
Guid id,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var result = await mediator.Send(new GetTrackStreamQuery(id, currentUser.RequiredId), cancellationToken);
|
||||
return result.ToHttpResult();
|
||||
}
|
||||
|
||||
private static async Task<IResult> GetTracksByUserId(
|
||||
IMediator mediator,
|
||||
Guid userId,
|
||||
|
||||
@@ -18,7 +18,9 @@ public static class ServiceCollectionExtensions
|
||||
services.AddApplicationStorageConfiguration(configuration);
|
||||
services.AddPlayListConfiguration(configuration);
|
||||
services.AddTrackConfiguration(configuration);
|
||||
services.AddStreamGatewayConfiguration(configuration);
|
||||
services.AddStorageService(configuration);
|
||||
services.AddStreamTicketService(configuration);
|
||||
services.AddUploadIntentConfiguration(configuration);
|
||||
services.AddMassTransitClient(configuration);
|
||||
services.AddMediator();
|
||||
|
||||
Reference in New Issue
Block a user