[#21] Client: Allows multinenant client
Using one client for several owners Signed-off-by: Pavel Gross <p.gross@yando.com>
This commit is contained in:
parent
18126ea763
commit
2a28806ace
30 changed files with 349 additions and 281 deletions
|
@ -17,17 +17,18 @@ internal class SessionServiceProvider : ContextAccessor
|
|||
|
||||
internal async Task<SessionToken> CreateSessionAsync(PrmSessionCreate args)
|
||||
{
|
||||
var ctx = args.Context!;
|
||||
var request = new CreateRequest
|
||||
{
|
||||
Body = new CreateRequest.Types.Body
|
||||
{
|
||||
OwnerId = Context.Owner.ToMessage(),
|
||||
OwnerId = ctx.OwnerId.ToMessage(),
|
||||
Expiration = args.Expiration
|
||||
}
|
||||
};
|
||||
|
||||
request.AddMetaHeader(args.XHeaders);
|
||||
request.Sign(Context.Key.ECDsaKey);
|
||||
request.Sign(ctx.Key);
|
||||
|
||||
return await CreateSession(request, args.Context!);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue