tgstation-server
6.12.3
The /tg/station 13 server suite
Loading...
Searching...
No Matches
src
Tgstation.Server.Client.GraphQL
Serializers
JwtSerializer.cs
Go to the documentation of this file.
1
using
System;
2
3
using
Microsoft.IdentityModel.JsonWebTokens;
4
5
using
StrawberryShake.Serialization;
6
7
#pragma warning disable CA1812
// not detecting usage via annotation in schema.extensions.graphql
8
9
namespace
Tgstation.Server.Client.GraphQL.Serializers
10
{
14
sealed
class
JwtSerializer
:
ScalarSerializer
<string, JsonWebToken>
15
{
19
public
JwtSerializer
()
20
: base(
"Jwt"
)
21
{
22
}
23
25
public
override
JsonWebToken
Parse
(
string
serializedValue)
26
=>
new
(serializedValue ??
throw
new
ArgumentNullException(nameof(serializedValue)));
27
29
protected
override
string
Format
(JsonWebToken runtimeValue)
30
{
31
ArgumentNullException.ThrowIfNull(runtimeValue);
32
return
runtimeValue.EncodedToken;
33
}
34
}
35
}
ScalarSerializer
Tgstation.Server.Client.GraphQL.Serializers.JwtSerializer
ScalarSerializer<TSerialized, TRuntime> for JsonWebTokens.
Definition
JwtSerializer.cs:15
Tgstation.Server.Client.GraphQL.Serializers.JwtSerializer.Parse
override JsonWebToken Parse(string serializedValue)
Tgstation.Server.Client.GraphQL.Serializers.JwtSerializer.Format
override string Format(JsonWebToken runtimeValue)
Definition
JwtSerializer.cs:29
Tgstation.Server.Client.GraphQL.Serializers.JwtSerializer.JwtSerializer
JwtSerializer()
Initializes a new instance of the JwtSerializer class.
Definition
JwtSerializer.cs:19
Tgstation.Server.Client.GraphQL.Serializers
Definition
JwtSerializer.cs:10
Generated by
1.9.8