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 | f389661667a510d6accfb412482578b66527e6e4 (patch) | |
tree | 57a8579bc8b6d2be2831c8e55d5b5b0f552def35 /Timeline/Entities/JwtTokenEntity.cs | |
parent | 3fa9899e17df4b1012e8b645915ac15022b84f9b (diff) | |
download | timeline-f389661667a510d6accfb412482578b66527e6e4.tar.gz timeline-f389661667a510d6accfb412482578b66527e6e4.tar.bz2 timeline-f389661667a510d6accfb412482578b66527e6e4.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
+ }
+}
|