diff options
author | crupest <crupest@outlook.com> | 2020-02-21 15:10:37 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-02-21 15:10:37 +0800 |
commit | 1d5d0c85e24fe9f30d587dc714f1cd7a233c8073 (patch) | |
tree | 57a8579bc8b6d2be2831c8e55d5b5b0f552def35 /Timeline/Entities/JwtTokenEntity.cs | |
parent | 6cf3c7891fe8a810b20bb799db9f3fb97414c4de (diff) | |
download | timeline-1d5d0c85e24fe9f30d587dc714f1cd7a233c8073.tar.gz timeline-1d5d0c85e24fe9f30d587dc714f1cd7a233c8073.tar.bz2 timeline-1d5d0c85e24fe9f30d587dc714f1cd7a233c8073.zip |
Move jwt token key from configuration to database and auto generatable.
Diffstat (limited to 'Timeline/Entities/JwtTokenEntity.cs')
-rw-r--r-- | Timeline/Entities/JwtTokenEntity.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Timeline/Entities/JwtTokenEntity.cs b/Timeline/Entities/JwtTokenEntity.cs new file mode 100644 index 00000000..40cb230a --- /dev/null +++ b/Timeline/Entities/JwtTokenEntity.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Timeline.Entities
+{
+ [Table("jwt_token")]
+ public class JwtTokenEntity
+ {
+ [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public long Id { get; set; }
+
+ [Required, Column("key")]
+#pragma warning disable CA1819 // Properties should not return arrays
+ public byte[] Key { get; set; } = default!;
+#pragma warning restore CA1819 // Properties should not return arrays
+ }
+}
|