-
Notifications
You must be signed in to change notification settings - Fork 391
Expand file tree
/
Copy pathBffRemoteApiEndpointMetadata.cs
More file actions
49 lines (43 loc) · 1.35 KB
/
BffRemoteApiEndpointMetadata.cs
File metadata and controls
49 lines (43 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) Duende Software. All rights reserved.
// See LICENSE in the project root for license information.
namespace Duende.Bff;
/// <summary>
/// Endpoint metadata for a remote BFF API endpoint
/// </summary>
public class BffRemoteApiEndpointMetadata : IBffApiEndpoint
{
/// <summary>
/// Required token type (if any)
/// </summary>
public TokenType? RequiredTokenType;
/// <summary>
/// Optionally send a user token if present
/// </summary>
public bool OptionalUserToken { get; set; }
/// <summary>
/// Maps to UserAccessTokenParameters and included if set
/// </summary>
public BffUserAccessTokenParameters? BffUserAccessTokenParameters { get; set; }
private Type _accessTokenRetriever = typeof(DefaultAccessTokenRetriever);
/// <summary>
/// The type used to retrieve access tokens.
/// </summary>
public Type AccessTokenRetriever
{
get
{
return _accessTokenRetriever;
}
set
{
if (value.IsAssignableTo(typeof(IAccessTokenRetriever)))
{
_accessTokenRetriever = value;
}
else
{
throw new InvalidOperationException("Attempt to assign a AccessTokenRetriever type that cannot be assigned to IAccessTokenTokenRetriever");
}
}
}
}