-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
421 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/IdServer/SimpleIdServer.IdServer.Domains/GotifySession.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright (c) SimpleIdServer. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. | ||
namespace SimpleIdServer.IdServer.Domains; | ||
|
||
public class GotifySession | ||
{ | ||
public string ApplicationToken { get; set; } = null!; | ||
public string ClientToken { get; set; } = null!; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/IdServer/SimpleIdServer.IdServer.Store/Configurations/GotifySessionConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) SimpleIdServer. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. | ||
|
||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
using SimpleIdServer.IdServer.Domains; | ||
|
||
namespace SimpleIdServer.IdServer.Store.Configurations; | ||
|
||
public class GotifySessionConfiguration : IEntityTypeConfiguration<GotifySession> | ||
{ | ||
public void Configure(EntityTypeBuilder<GotifySession> builder) | ||
{ | ||
builder.HasKey(g => g.ApplicationToken); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/IdServer/SimpleIdServer.IdServer.Store/GotifySessionStore.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) SimpleIdServer. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
using SimpleIdServer.IdServer.Domains; | ||
|
||
namespace SimpleIdServer.IdServer.Store; | ||
|
||
public interface IGotiySessionStore | ||
{ | ||
void Add(GotifySession session); | ||
Task<GotifySession> GetByClientToken(string clientToken, CancellationToken cancellationToken); | ||
Task<int> SaveChanges(CancellationToken cancellationToken); | ||
} | ||
|
||
public class GotiySessionStore : IGotiySessionStore | ||
{ | ||
private readonly StoreDbContext _dbContext; | ||
|
||
public GotiySessionStore(StoreDbContext dbContext) | ||
{ | ||
_dbContext = dbContext; | ||
} | ||
|
||
public void Add(GotifySession session) | ||
=> _dbContext.GotifySessions.Add(session); | ||
|
||
public Task<GotifySession> GetByClientToken(string clientToken, CancellationToken cancellationToken) | ||
=> _dbContext.GotifySessions.SingleOrDefaultAsync(c => c.ClientToken == clientToken, cancellationToken); | ||
|
||
public Task<int> SaveChanges(CancellationToken cancellationToken) | ||
=> _dbContext.SaveChangesAsync(cancellationToken); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+25.7 KB
src/IdServer/SimpleIdServer.IdServer.Website/wwwroot/images/gotify.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.