blob: f9f358cf6d0080794ac19f65a83c4fd4c0f793a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
using PKISharp.WACS.Configuration;
using PKISharp.WACS.DomainObjects;
using PKISharp.WACS.Services;
using System.Threading.Tasks;
namespace PKISharp.WACS.Plugins.ValidationPlugins.Http
{
internal class WebDavOptionsFactory : HttpValidationOptionsFactory<WebDav, WebDavOptions>
{
public WebDavOptionsFactory(IArgumentsService arguments) : base(arguments) { }
public override bool PathIsValid(string webRoot)
{
return
webRoot.StartsWith("\\\\") ||
webRoot.StartsWith("dav://") ||
webRoot.StartsWith("webdav://") ||
webRoot.StartsWith("https://") ||
webRoot.StartsWith("http://");
}
public override string[] WebrootHint(bool allowEmtpy)
{
return new[] {
"Enter a webdav path that leads to the web root of the host for http authentication",
" Example, \\\\domain.com:80\\",
" Example, \\\\domain.com:443\\"
};
}
public override async Task<WebDavOptions?> Default(Target target)
{
return new WebDavOptions(BaseDefault(target))
{
Credential = new NetworkCredentialOptions(_arguments)
};
}
public override async Task<WebDavOptions?> Aquire(Target target, IInputService inputService, RunLevel runLevel)
{
return new WebDavOptions(await BaseAquire(target, inputService))
{
Credential = new NetworkCredentialOptions(_arguments, inputService)
};
}
}
}
|