-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
SecurityManager.cs
45 lines (38 loc) · 1.21 KB
/
SecurityManager.cs
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
using System;
namespace XVLauncher
{
/// <summary>
/// Singleton class to generate php files path, just to avoid to put it as plain text.
/// It is a really basic security system, do not use it to protect sensible data.
/// </summary>
class SecurityManager
{
private readonly string PATH;
private static SecurityManager instance = null;
private SecurityManager(string path)
{
this.PATH = path;
}
/// <summary>
/// Singleton pattern's getter method.
/// </summary>
/// <returns>Singleton instance of <see cref="SecurityManager"/>.</returns>
public static SecurityManager GetInstance()
{
if (instance is null)
{
instance = new SecurityManager(GeneratePath());
}
return instance;
}
public string GetPath()
{
return PATH;
}
private static string GeneratePath()
{
// TODO: implement a method that return php files path (ex: https://www.example.com/my-path/)
throw new NotImplementedException("SecurityManager.GeneratePath() is not implemented!");
}
}
}