-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not store password, just the session
Encrypted session data stored in binary format
- Loading branch information
Showing
20 changed files
with
317 additions
and
309 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using SqlCeLibrary; | ||
|
||
namespace SynAudio.DAL | ||
{ | ||
[Table("ByteArray")] | ||
public class ByteArrayValue | ||
{ | ||
[Column, PrimaryKey] | ||
public string Key { get; set; } | ||
[Column] | ||
public byte[] Value { get; set; } | ||
|
||
public static byte[] Read(SqlCe sql, string key) => sql.SelectFirstByPrimaryKeys<ByteArrayValue>(key)?.Value; | ||
public static bool TryRead(SqlCe sql, string key, out byte[] value) | ||
{ | ||
var v = sql.SelectFirstByPrimaryKeys<ByteArrayValue>(key); | ||
value = v?.Value; | ||
return !(value is null); | ||
} | ||
public static void Write(SqlCe sql, string key, byte[] value) | ||
{ | ||
sql.DeleteSingleByPrimaryKey<ByteArrayValue>(key); | ||
if (value?.Length > 0 == true) | ||
sql.Insert(new ByteArrayValue() { Key = key, Value = value }); | ||
} | ||
} | ||
} |
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,7 @@ | ||
namespace SynAudio.DAL | ||
{ | ||
public enum ByteArrayValues | ||
{ | ||
AudioStationConnectorSession | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
{ | ||
public enum StringValues | ||
{ | ||
AudioStationConnectorSession, | ||
NowPlaying_CurrentSongId | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace SynAudio.Models | ||
{ | ||
public class Credentials | ||
{ | ||
public string Url { get; set; } = string.Empty; | ||
public string Username { get; set; } = string.Empty; | ||
public string Password { get; set; } = string.Empty; | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.