-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Hex encoded password as a method of authentication
- Loading branch information
Showing
5 changed files
with
221 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System; | ||
using System.Security.Policy; | ||
|
||
namespace MusicBeePlugin.Domain | ||
{ | ||
public class SubsonicSettings | ||
{ | ||
public string Host { get; set; } | ||
public string Port { get; set; } | ||
public string BasePath { get; set; } | ||
public string Username { get; set; } | ||
public string Password { get; set; } | ||
public bool Transcode { get; set; } | ||
public ConnectionProtocol Protocol { get; set; } | ||
public AuthMethod Auth { get; set; } | ||
|
||
public enum ConnectionProtocol | ||
{ | ||
Http, | ||
Https | ||
} | ||
|
||
public enum AuthMethod | ||
{ | ||
Token, | ||
HexPass | ||
} | ||
} | ||
|
||
public static class SubsonicSettingsExtensions | ||
{ | ||
public static string ToFriendlyString(this SubsonicSettings.ConnectionProtocol me) | ||
{ | ||
switch (me) | ||
{ | ||
case SubsonicSettings.ConnectionProtocol.Http: | ||
return "HTTP"; | ||
case SubsonicSettings.ConnectionProtocol.Https: | ||
return "HTTPS"; | ||
default: | ||
throw new ArgumentOutOfRangeException(nameof(me), me, null); | ||
} | ||
} | ||
|
||
public static string ToFriendlyString(this SubsonicSettings.AuthMethod me) | ||
{ | ||
switch (me) | ||
{ | ||
case SubsonicSettings.AuthMethod.Token: | ||
return "Token"; | ||
case SubsonicSettings.AuthMethod.HexPass: | ||
return "HexPass"; | ||
default: | ||
throw new ArgumentOutOfRangeException(nameof(me), me, 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
Oops, something went wrong.