Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. todo: check documentation & format 2. todo: add support for list roles.. 3. todo: verify with local MS SQL db
- Loading branch information
Showing
7 changed files
with
231 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
src/VaultSharp/Backends/Secret/Models/MicrosoftSql/MicrosoftSqlConnectionInfo.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,52 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace VaultSharp.Backends.Secret.Models.MicrosoftSql | ||
{ | ||
/// <summary> | ||
/// Represents the Microsoft Sql connection information. | ||
/// </summary> | ||
public class MicrosoftSqlConnectionInfo | ||
{ | ||
/// <summary> | ||
/// <para>[required]</para> | ||
/// Gets or sets the connection DSN used to communicate with Sql Server. | ||
/// </summary> | ||
/// <value> | ||
/// The MSSQL DSN | ||
/// </value> | ||
[JsonProperty("connection_string ")] | ||
public string ConnectionString { get; set; } | ||
|
||
/// <summary> | ||
/// <para>[optional]</para> | ||
/// Gets or sets the maximum number of open connections to the database. | ||
/// Defaults to 2. | ||
/// </summary> | ||
/// <value> | ||
/// The maximum open connections. | ||
/// </value> | ||
[JsonProperty("max_open_connections")] | ||
public int MaximumOpenConnections { get; set; } | ||
|
||
/// <summary> | ||
/// <para>[optional]</para> | ||
/// Gets or sets a flag which when set verifies the <see cref="ConnectionString"/> by | ||
/// actually connecting to the database. | ||
/// Defaults to true. | ||
/// </summary> | ||
/// <value> | ||
/// A flag to verify the connection. | ||
/// </value> | ||
[JsonProperty("verify_connection")] | ||
public bool VerifyConnection { get; set; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="MicrosoftSqlConnectionInfo" /> class. | ||
/// </summary> | ||
public MicrosoftSqlConnectionInfo() | ||
{ | ||
MaximumOpenConnections = 2; | ||
VerifyConnection = true; | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/VaultSharp/Backends/Secret/Models/MicrosoftSql/MicrosoftSqlRoleDefinition.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,22 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace VaultSharp.Backends.Secret.Models.MicrosoftSql | ||
{ | ||
/// <summary> | ||
/// Represents the Microsoft Sql role definition | ||
/// </summary> | ||
public class MicrosoftSqlRoleDefinition | ||
{ | ||
/// <summary> | ||
/// <para>[required]</para> | ||
/// Gets or sets the SQL statements executed to create and configure the role. | ||
/// Must be semi-colon separated. | ||
/// The '{{name}}' and '{{password}}' values will be substituted. | ||
/// </summary> | ||
/// <value> | ||
/// The SQL. | ||
/// </value> | ||
[JsonProperty("sql")] | ||
public string Sql { get; set; } | ||
} | ||
} |
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