Interface IScriptBuilder
The script builder used to create a script of commands to apply to the system authentication store at the server.
Namespace: PushTechnology.ClientInterface.Client.Features.Control.Clients
Assembly: Diffusion.Client.dll
Syntax
public interface IScriptBuilder
Remarks
Each method call on the builder adds a line to the script and then the script may be built using the
ToScript() method which produces a System.String
script which may be sent
to the server using UpdateStoreAsync(String).
This builder can be accessed with the Script property.
From Diffusion 6.5, script builders are no longer immutable. Each builder operation mutates this script builder and returns it.
Methods
AbstainAnonymousConnections()
Instructs the system authentication handler to defer authentication decisions for anonymous connections to subsequent handlers.
Declaration
IScriptBuilder AbstainAnonymousConnections()
Returns
Type | Description |
---|---|
IScriptBuilder | This builder, modified to abstain anonymous connections. |
AddPrincipal(String, String, IEnumerable<String>)
Adds a new principal.
Declaration
IScriptBuilder AddPrincipal(string name, string password, IEnumerable<string> roles)
Parameters
Type | Name | Description |
---|---|---|
String | name | The principal name. |
String | password | The password. |
IEnumerable<String> | roles | The roles to be assigned to the principal. |
Returns
Type | Description |
---|---|
IScriptBuilder | This builder, modified to add the new principal. |
Remarks
The script will fail if the principal is already defined at the server.
AddPrincipal(String, String, IEnumerable<String>, String)
Adds a new locked principal.
Declaration
IScriptBuilder AddPrincipal(string name, string password, IEnumerable<string> roles, string lockingPrincipal)
Parameters
Type | Name | Description |
---|---|---|
String | name | The principal name. |
String | password | The password. |
IEnumerable<String> | roles | The roles to be assigned to the principal. |
String | lockingPrincipal | The name of the principal that can edit this principal. |
Returns
Type | Description |
---|---|
IScriptBuilder | This builder, modified to add the new locked principal. |
Remarks
A locked principal can only be edited by the principal defined in the lock. The script will fail if the principal is already defined at the server.
AllowAnonymousConnections(IEnumerable<String>)
Instructs the system authentication handler to allow anonymous connections.
Declaration
IScriptBuilder AllowAnonymousConnections(IEnumerable<string> roles)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<String> | roles | The roles to assign to anonymous sessions. |
Returns
Type | Description |
---|---|
IScriptBuilder | This builder, modified to allow anonymous connections. |
Append(IScriptBuilder)
Appends all the operations of a given builder to the current builder.
Declaration
IScriptBuilder Append(IScriptBuilder other)
Parameters
Type | Name | Description |
---|---|---|
IScriptBuilder | other | The builder to append to the current builder. |
Returns
Type | Description |
---|---|
IScriptBuilder | A new copy of the current builder that also includes all operations of |
AssignRoles(String, IEnumerable<String>)
Changes a principal's assigned roles.
Declaration
IScriptBuilder AssignRoles(string principal, IEnumerable<string> roles)
Parameters
Type | Name | Description |
---|---|---|
String | principal | The principal name. |
IEnumerable<String> | roles | The roles to be assigned to the |
Returns
Type | Description |
---|---|
IScriptBuilder | This builder, modified to assign the new roles. |
Remarks
The specified principal must already be defined at the server.
DenyAnonymousConnections()
Instructs the system authentication handler to deny anonymous connections.
Declaration
IScriptBuilder DenyAnonymousConnections()
Returns
Type | Description |
---|---|
IScriptBuilder | This builder, modified to deny anonymous connections. |
IgnoreClientProposedProperty(String)
Specifies the name of a client proposed session property that should now be ignored by the system authenticator. This removes the effect of a previous request to trust the named property.
Declaration
IScriptBuilder IgnoreClientProposedProperty(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | Specifies the name of the client proposed property to be ignored. |
Returns
Type | Description |
---|---|
IScriptBuilder | This builder, modified to ignore the specified client proposed property. |
RemovePrincipal(String)
Removes a principal.
Declaration
IScriptBuilder RemovePrincipal(string principal)
Parameters
Type | Name | Description |
---|---|---|
String | principal | The principal name. |
Returns
Type | Description |
---|---|
IScriptBuilder | This builder, modified to remove the principal. |
Remarks
The principal must be one that is already defined at the server.
SetPassword(String, String)
Sets a principal's password.
Declaration
IScriptBuilder SetPassword(string principal, string password)
Parameters
Type | Name | Description |
---|---|---|
String | principal | The principal name. |
String | password | The password. |
Returns
Type | Description |
---|---|
IScriptBuilder | This builder, modified to set the password. |
Remarks
The principal must already be defined at the server in order to set the password.
ToScript()
Creates a new script.
Declaration
string ToScript()
Returns
Type | Description |
---|---|
String | The script. |
TrustClientProposedPropertyIn(String, IEnumerable<String>)
Specifies the name of a client proposed session property that should be allowed by the system authenticator along with a set of permissible values. The property will only be allowed if the supplied value matches one of those in the set of values specified.
Declaration
IScriptBuilder TrustClientProposedPropertyIn(string propertyName, IEnumerable<string> allowedValues)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | Specifies the name of the client proposed property to be allowed. |
IEnumerable<String> | allowedValues | Specifies a set of allowed values for the client proposed property. |
Returns
Type | Description |
---|---|
IScriptBuilder | This builder, modified to allow the specified client proposed property if its value matches one of those supplied. |
TrustClientProposedPropertyMatches(String, String)
Specifies the name of a client proposed session property that should be allowed by the system authenticator along with a regular expression to validate the property value. The property will only be allowed if the supplied value matches with the regular expression.
Declaration
IScriptBuilder TrustClientProposedPropertyMatches(string propertyName, string regex)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | Specifies the name of the client proposed property to be allowed. |
String | regex | Regular expression which will be matched against supplied values to determine whether they are valid. |
Returns
Type | Description |
---|---|
IScriptBuilder | This builder, modified to allow the specified client proposed property if its value matches the given regular expression. |
VerifyPassword(String, String)
Asserts that a principal's password is the same as the given password
.
Declaration
IScriptBuilder VerifyPassword(string principal, string password)
Parameters
Type | Name | Description |
---|---|---|
String | principal | The principal name. |
String | password | The password. |
Returns
Type | Description |
---|---|
IScriptBuilder | This builder, modified to verify the password. |
Remarks
This command does not update the store. It can be used in conjunction with SetPassword(String, String) to create a script that updates a password only if the previous password is supplied.