Example #1
0
        /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
        public JwtMember(JsonEncodedText memberName, string value)
        {
            if (value == null)
            {
                ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value);
            }

            Type  = JwtValueKind.String;
            Value = value;
            Name  = memberName;
        }
Example #2
0
 internal static Exception CreateInvalidOperationException_NotSupportedJsonType(JwtValueKind type) => new InvalidOperationException($"The type {type} is not supported.");
Example #3
0
 internal static void ThrowInvalidOperationException_NotSupportedJsonType(JwtValueKind type) => throw CreateInvalidOperationException_NotSupportedJsonType(type);
Example #4
0
 private static Exception CreateJwtDescriptorException_HeaderMustBeOfType(JsonEncodedText utf8Name, JwtValueKind type) => new JwtDescriptorException($"The header parameter '{utf8Name}' must be of type {type}.");
Example #5
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, ulong value)
 {
     Type  = JwtValueKind.UInt64;
     Value = value;
     Name  = memberName;
 }
Example #6
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, uint value)
 {
     Type  = JwtValueKind.UInt32;
     Value = value;
     Name  = memberName;
 }
Example #7
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, object?[] value)
 {
     Type  = JwtValueKind.Array;
     Value = value;
     Name  = memberName;
 }
Example #8
0
 public static bool IsInteger(this JwtValueKind kind)
 {
     return(((uint)kind & 0x80) != 0x00);
 }
Example #9
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, float value)
 {
     Type  = JwtValueKind.Float;
     Value = value;
     Name  = memberName;
 }
Example #10
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, bool value)
 {
     Type  = value ? JwtValueKind.True : JwtValueKind.False;
     Value = value;
     Name  = memberName;
 }
Example #11
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, double value)
 {
     Type  = JwtValueKind.Double;
     Value = value;
     Name  = memberName;
 }
Example #12
0
 public static bool IsStringOrArray(this JwtValueKind kind)
 {
     return(((uint)kind & 0x0c) != 0x00);
 }
Example #13
0
 public static bool IsFloat(this JwtValueKind kind)
 {
     return(((uint)kind & 0x40) != 0x00);
 }
Example #14
0
 internal static void ThrowJwtDescriptorException_ClaimMustBeOfType(JsonEncodedText utf8Name, JwtValueKind type) => throw CreateJwtDescriptorException_ClaimMustBeOfType(utf8Name, type);
Example #15
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, JsonEncodedText value)
 {
     Type  = JwtValueKind.JsonEncodedString;
     Value = value;
     Name  = memberName;
 }
Example #16
0
 private static Exception CreateJwtDescriptorException_ClaimMustBeOfType(JsonEncodedText utf8Name, JwtValueKind type) => new JwtDescriptorException($"The claim '{utf8Name}' must be of type {type}.");
Example #17
0
 public static bool IsNumber(this JwtValueKind kind)
 {
     return(((uint)kind & 0xc0) != 0x00);
 }