Proxy
This commit is contained in:
@@ -33,6 +33,16 @@
|
|||||||
"ApplicationStorage": {
|
"ApplicationStorage": {
|
||||||
"Bucket": "webapi-storage"
|
"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": {
|
"OpenTelemetry": {
|
||||||
"OtlpEndpoint": "http://localhost:4317"
|
"OtlpEndpoint": "http://localhost:4317"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -34,6 +34,16 @@
|
|||||||
"ApplicationStorage": {
|
"ApplicationStorage": {
|
||||||
"Bucket": ""
|
"Bucket": ""
|
||||||
},
|
},
|
||||||
|
"StreamGateway": {
|
||||||
|
"PublicBaseUrl": "",
|
||||||
|
"ManifestFileName": "manifest.mpd"
|
||||||
|
},
|
||||||
|
"StreamTicket": {
|
||||||
|
"PrivateKeyPath": "",
|
||||||
|
"Audience": "media-gateway",
|
||||||
|
"Issuer": "musify-webapi",
|
||||||
|
"TicketTtlSeconds": 3600
|
||||||
|
},
|
||||||
"OpenTelemetry": {
|
"OpenTelemetry": {
|
||||||
"OtlpEndpoint": ""
|
"OtlpEndpoint": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -23,6 +23,11 @@ public static class TrackEndpoints
|
|||||||
.WithName("GetTrackById")
|
.WithName("GetTrackById")
|
||||||
.WithSummary("Get A Track By Id.");
|
.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)
|
group.MapGet("/users/{userId}", GetTracksByUserId)
|
||||||
.WithName("GetTracksByUserId")
|
.WithName("GetTracksByUserId")
|
||||||
.WithSummary("Get Paginated Tracks For A User.");
|
.WithSummary("Get Paginated Tracks For A User.");
|
||||||
@@ -66,6 +71,16 @@ public static class TrackEndpoints
|
|||||||
return result.ToHttpResult();
|
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(
|
private static async Task<IResult> GetTracksByUserId(
|
||||||
IMediator mediator,
|
IMediator mediator,
|
||||||
Guid userId,
|
Guid userId,
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ public static class ServiceCollectionExtensions
|
|||||||
services.AddApplicationStorageConfiguration(configuration);
|
services.AddApplicationStorageConfiguration(configuration);
|
||||||
services.AddPlayListConfiguration(configuration);
|
services.AddPlayListConfiguration(configuration);
|
||||||
services.AddTrackConfiguration(configuration);
|
services.AddTrackConfiguration(configuration);
|
||||||
|
services.AddStreamGatewayConfiguration(configuration);
|
||||||
services.AddStorageService(configuration);
|
services.AddStorageService(configuration);
|
||||||
|
services.AddStreamTicketService(configuration);
|
||||||
services.AddUploadIntentConfiguration(configuration);
|
services.AddUploadIntentConfiguration(configuration);
|
||||||
services.AddMassTransitClient(configuration);
|
services.AddMassTransitClient(configuration);
|
||||||
services.AddMediator();
|
services.AddMediator();
|
||||||
|
|||||||
Reference in New Issue
Block a user