Skip to content

Commit e8a53b7

Browse files
committed
Clarify comments, fix sample migration
1 parent 2d5318f commit e8a53b7

File tree

7 files changed

+249
-19
lines changed

7 files changed

+249
-19
lines changed

src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/ApiAuthSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
55
<UserSecretsId>aspnet-ApiAuthSample-12ED8ECC-9EF1-4D31-87B4-1405B3198E5E</UserSecretsId>
6-
<!-- IdentityServer packages are not signed -->
6+
<!-- IdentityServer packages are not strong named -->
77
<NoWarn>CS8002</NoWarn>
88
<!-- We are a package that depends on the shared framework, this allows us to
99
avoid errors during restore -->

src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/20180919224505_InitialMigration.Designer.cs

Lines changed: 90 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/20180919224505_InitialMigration.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,41 @@ protected override void Up(MigrationBuilder migrationBuilder)
4646
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
4747
});
4848

49+
migrationBuilder.CreateTable(
50+
name: "DeviceCodes",
51+
columns: table => new
52+
{
53+
UserCode = table.Column<string>(maxLength: 200, nullable: false),
54+
DeviceCode = table.Column<string>(maxLength: 200, nullable: false),
55+
SubjectId = table.Column<string>(maxLength: 200, nullable: true),
56+
ClientId = table.Column<string>(maxLength: 200, nullable: false),
57+
CreationTime = table.Column<DateTime>(nullable: false),
58+
Expiration = table.Column<DateTime>(nullable: false),
59+
Data = table.Column<string>(maxLength: 50000, nullable: false)
60+
},
61+
constraints: table =>
62+
{
63+
table.PrimaryKey("PK_DeviceCodes", x => x.UserCode);
64+
});
65+
66+
migrationBuilder.CreateTable(
67+
name: "Keys",
68+
columns: table => new
69+
{
70+
Id = table.Column<string>(nullable: false),
71+
Version = table.Column<int>(nullable: false),
72+
Created = table.Column<DateTime>(nullable: false),
73+
Use = table.Column<string>(nullable: true),
74+
Algorithm = table.Column<string>(maxLength: 100, nullable: false),
75+
IsX509Certificate = table.Column<bool>(nullable: false),
76+
DataProtected = table.Column<bool>(nullable: false),
77+
Data = table.Column<string>(nullable: false)
78+
},
79+
constraints: table =>
80+
{
81+
table.PrimaryKey("PK_Keys", x => x.Id);
82+
});
83+
4984
migrationBuilder.CreateTable(
5085
name: "PersistedGrants",
5186
columns: table => new

src/Identity/ApiAuthorization.IdentityServer/samples/ApiAuthSample/Data/Migrations/ApplicationDbContextModelSnapshot.cs

Lines changed: 119 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,145 @@ protected override void BuildModel(ModelBuilder modelBuilder)
1616
modelBuilder
1717
.HasAnnotation("ProductVersion", "2.1.3-rtm-32065");
1818

19-
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
19+
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes", b =>
2020
{
21-
b.Property<string>("Key")
22-
.HasMaxLength(200);
21+
b.Property<string>("UserCode")
22+
.HasMaxLength(200)
23+
.HasColumnType("TEXT");
2324

2425
b.Property<string>("ClientId")
2526
.IsRequired()
26-
.HasMaxLength(200);
27+
.HasMaxLength(200)
28+
.HasColumnType("TEXT");
29+
30+
b.Property<DateTime>("CreationTime")
31+
.HasColumnType("TEXT");
32+
33+
b.Property<string>("Data")
34+
.IsRequired()
35+
.HasMaxLength(50000)
36+
.HasColumnType("TEXT");
37+
38+
b.Property<string>("Description")
39+
.HasMaxLength(200)
40+
.HasColumnType("TEXT");
41+
42+
b.Property<string>("DeviceCode")
43+
.IsRequired()
44+
.HasMaxLength(200)
45+
.HasColumnType("TEXT");
46+
47+
b.Property<DateTime?>("Expiration")
48+
.IsRequired()
49+
.HasColumnType("TEXT");
50+
51+
b.Property<string>("SessionId")
52+
.HasMaxLength(100)
53+
.HasColumnType("TEXT");
54+
55+
b.Property<string>("SubjectId")
56+
.HasMaxLength(200)
57+
.HasColumnType("TEXT");
58+
59+
b.HasKey("UserCode");
60+
61+
b.HasIndex("DeviceCode")
62+
.IsUnique();
63+
64+
b.HasIndex("Expiration");
65+
66+
b.ToTable("DeviceCodes");
67+
});
68+
69+
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Key", b =>
70+
{
71+
b.Property<string>("Id")
72+
.HasMaxLength(450)
73+
.HasColumnType("TEXT");
74+
75+
b.Property<string>("Algorithm")
76+
.IsRequired()
77+
.HasMaxLength(100)
78+
.HasColumnType("TEXT");
2779

28-
b.Property<DateTime>("CreationTime");
80+
b.Property<DateTime>("Created")
81+
.HasColumnType("TEXT");
2982

3083
b.Property<string>("Data")
3184
.IsRequired()
85+
.HasColumnType("TEXT")
3286
.HasMaxLength(50000);
87+
88+
b.Property<bool>("DataProtected")
89+
.HasColumnType("bit");
3390

34-
b.Property<DateTime?>("Expiration");
91+
b.Property<bool>("IsX509Certificate")
92+
.HasColumnType("bit");
93+
94+
b.Property<string>("Use")
95+
.HasMaxLength(450)
96+
.HasColumnType("TEXT");
97+
98+
b.Property<int>("Version")
99+
.HasColumnType("int");
100+
101+
b.HasKey("Id");
102+
103+
b.HasIndex("Use");
104+
105+
b.ToTable("Keys");
106+
});
107+
108+
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.PersistedGrant", b =>
109+
{
110+
b.Property<string>("Key")
111+
.HasMaxLength(200)
112+
.HasColumnType("TEXT");
113+
114+
b.Property<string>("ClientId")
115+
.IsRequired()
116+
.HasMaxLength(200)
117+
.HasColumnType("TEXT");
118+
119+
b.Property<DateTime?>("ConsumedTime")
120+
.HasColumnType("TEXT");
121+
122+
b.Property<DateTime>("CreationTime")
123+
.HasColumnType("TEXT");
124+
125+
b.Property<string>("Data")
126+
.IsRequired()
127+
.HasMaxLength(50000)
128+
.HasColumnType("TEXT");
129+
130+
b.Property<string>("Description")
131+
.HasMaxLength(200)
132+
.HasColumnType("TEXT");
133+
134+
b.Property<DateTime?>("Expiration")
135+
.HasColumnType("TEXT");
136+
137+
b.Property<string>("SessionId")
138+
.HasMaxLength(100)
139+
.HasColumnType("TEXT");
35140

36141
b.Property<string>("SubjectId")
37-
.HasMaxLength(200);
142+
.HasMaxLength(200)
143+
.HasColumnType("TEXT");
38144

39145
b.Property<string>("Type")
40146
.IsRequired()
41-
.HasMaxLength(50);
147+
.HasMaxLength(50)
148+
.HasColumnType("TEXT");
42149

43150
b.HasKey("Key");
44151

152+
b.HasIndex("Expiration");
153+
45154
b.HasIndex("SubjectId", "ClientId", "Type");
46155

156+
b.HasIndex("SubjectId", "SessionId", "Type");
157+
47158
b.ToTable("PersistedGrants");
48159
});
49160

src/Identity/ApiAuthorization.IdentityServer/src/Data/ApiAuthorizationDbContext.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,8 @@ public ApiAuthorizationDbContext(
4646
public DbSet<DeviceFlowCodes> DeviceFlowCodes { get; set; }
4747

4848
/// <summary>
49-
/// Gets or sets the keys.
49+
/// Gets or sets the <see cref="DbSet{Key}"/>.
5050
/// </summary>
51-
/// <value>
52-
/// The keys.
53-
/// </value>
5451
public DbSet<Key> Keys { get; set; }
5552

5653
Task<int> IPersistedGrantDbContext.SaveChangesAsync() => base.SaveChangesAsync();

src/Identity/ApiAuthorization.IdentityServer/src/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
<!-- We are a package that depends on the shared framework, this allows us to
99
avoid errors during restore -->
1010
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
11-
<!-- IdentityServer packages are not signed -->
11+
<!-- IdentityServer packages are not strong named -->
1212
<NoWarn>CS8002</NoWarn>
1313
<Nullable>disable</Nullable>
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<!-- Remove the reference to Microsoft.AspNetCore.App from IdentityServer4 -->
17+
<!-- Remove the reference to Microsoft.AspNetCore.App from Duende.IdentityServer -->
1818
<FrameworkReference Remove="Microsoft.AspNetCore.App" />
1919
<Reference Include="Duende.IdentityServer.AspNetIdentity" />
2020
<Reference Include="Duende.IdentityServer.EntityFramework" />

src/Identity/ApiAuthorization.IdentityServer/test/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- We are a package that depends on the shared framework, this allows us to
66
avoid errors during restore -->
77
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
8-
<!-- IdentityServer packages are not signed -->
8+
<!-- IdentityServer packages are not strong named -->
99
<NoWarn>CS8002</NoWarn>
1010
</PropertyGroup>
1111

0 commit comments

Comments
 (0)