NookPost-Backend
Loading...
Searching...
No Matches
NookpostBackend.Configuration.Settings Class Reference

Singleton that holds settings about the server. Automatically loaded and set up by static constructor. More...

Collaboration diagram for NookpostBackend.Configuration.Settings:

Public Member Functions

 Settings (byte[] _jwtIssuerSigningKey, string _serverUserPasswordPepper, long _maxAllowedPostStringSize)
 Constructor used for JSON loading, takes all parameters and creates a new settings object.
 
 Settings ()
 Initialize a new settings object with default values.
 

Static Public Member Functions

static void LoadSettings ()
 Read the settings from the settings.json file and place them into the singleton instance variable. Create a default instance if the file can't be read.
 
static void SaveSettings ()
 Save settings to the settings.json file.
 

Static Public Attributes

const int JwtSigningKeyLength = 256
 The set length for the JWT signing key.
 
const int ServerUserPasswordPepperLength = 32
 The length of the pepper applied to user passwords.
 
const int UserPasswordSaltLength = 32
 The length of the salt applied to user passwords.
 

Properties

static byte[] JwtIssuerSigningKey [get, private set]
 The key used for signing json web tokens.
 
byte[] _jwtIssuerSigningKey [get, private set]
 The background property for the jwt signing key. Should not be directly accessed! Use Settings.JwtIssuerSigningKey instead!
 
static string ServerUserPasswordPepper [get, set]
 The pepper applied to user passwords universally on this server.
 
string _serverUserPasswordPepper [get, private set]
 The pepper applied to user passwords universally on this server. Should not be directly accessed! Use Settings.ServerUserPasswordPepper instead!
 
static long MaxAllowedPostStringSize [get, set]
 The maximum allowed size of strings contained in posts, like title, body, etc.
 
long _maxAllowedPostStringSize [get, private set]
 The background property for the maximum allowed size of strings contained in posts, like title, body, etc. Should not be directly accessed! Use Settings.MaxAllowedPostStringSize instead!
 

Static Private Member Functions

static Settings ()
 Initializes the settings on first access, and saves them again should they be newly generated.
 
static Settings ReadSettings ()
 Read the settings from the settings.json file. Create a default instance if the file can't be read.
 
static bool isSettingsIntegrityOk (Settings settings)
 

Static Private Attributes

static Settings _instance
 Instance of the settings class.
 

Detailed Description

Singleton that holds settings about the server. Automatically loaded and set up by static constructor.

Constructor & Destructor Documentation

◆ Settings() [1/3]

static NookpostBackend.Configuration.Settings.Settings ( )
inlinestaticprivate

Initializes the settings on first access, and saves them again should they be newly generated.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Settings() [2/3]

NookpostBackend.Configuration.Settings.Settings ( byte[] _jwtIssuerSigningKey,
string _serverUserPasswordPepper,
long _maxAllowedPostStringSize )
inline

Constructor used for JSON loading, takes all parameters and creates a new settings object.

◆ Settings() [3/3]

NookpostBackend.Configuration.Settings.Settings ( )
inline

Initialize a new settings object with default values.

Here is the call graph for this function:

Member Function Documentation

◆ isSettingsIntegrityOk()

static bool NookpostBackend.Configuration.Settings.isSettingsIntegrityOk ( Settings settings)
inlinestaticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadSettings()

static void NookpostBackend.Configuration.Settings.LoadSettings ( )
inlinestatic

Read the settings from the settings.json file and place them into the singleton instance variable. Create a default instance if the file can't be read.

Here is the call graph for this function:

◆ ReadSettings()

static Settings NookpostBackend.Configuration.Settings.ReadSettings ( )
inlinestaticprivate

Read the settings from the settings.json file. Create a default instance if the file can't be read.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaveSettings()

static void NookpostBackend.Configuration.Settings.SaveSettings ( )
inlinestatic

Save settings to the settings.json file.

Here is the caller graph for this function:

Member Data Documentation

◆ _instance

Settings NookpostBackend.Configuration.Settings._instance
staticprivate

Instance of the settings class.

◆ JwtSigningKeyLength

const int NookpostBackend.Configuration.Settings.JwtSigningKeyLength = 256
static

The set length for the JWT signing key.

◆ ServerUserPasswordPepperLength

const int NookpostBackend.Configuration.Settings.ServerUserPasswordPepperLength = 32
static

The length of the pepper applied to user passwords.

◆ UserPasswordSaltLength

const int NookpostBackend.Configuration.Settings.UserPasswordSaltLength = 32
static

The length of the salt applied to user passwords.

Property Documentation

◆ _jwtIssuerSigningKey

byte [] NookpostBackend.Configuration.Settings._jwtIssuerSigningKey
getprivate set

The background property for the jwt signing key. Should not be directly accessed! Use Settings.JwtIssuerSigningKey instead!

◆ _maxAllowedPostStringSize

long NookpostBackend.Configuration.Settings._maxAllowedPostStringSize
getprivate set

The background property for the maximum allowed size of strings contained in posts, like title, body, etc. Should not be directly accessed! Use Settings.MaxAllowedPostStringSize instead!

◆ _serverUserPasswordPepper

string NookpostBackend.Configuration.Settings._serverUserPasswordPepper
getprivate set

The pepper applied to user passwords universally on this server. Should not be directly accessed! Use Settings.ServerUserPasswordPepper instead!

◆ JwtIssuerSigningKey

byte [] NookpostBackend.Configuration.Settings.JwtIssuerSigningKey
staticgetprivate set

The key used for signing json web tokens.

◆ MaxAllowedPostStringSize

long NookpostBackend.Configuration.Settings.MaxAllowedPostStringSize
staticgetset

The maximum allowed size of strings contained in posts, like title, body, etc.

◆ ServerUserPasswordPepper

string NookpostBackend.Configuration.Settings.ServerUserPasswordPepper
staticgetset

The pepper applied to user passwords universally on this server.


The documentation for this class was generated from the following file: