Documentation
¶
Index ¶
- Constants
- func GetDefaultLogPath() string
- func GetReleaseVersion() string
- func GetVersionJSON() (string, error)
- func SetLog(logDir string)
- type Config
- func (config *Config) GetDeniedUsers() []string
- func (config *Config) GetHomeDirPath() string
- func (config *Config) GetSharedDirName() string
- func (config *Config) HasSFTPGoAPI() bool
- func (config *Config) HasSharedDir() bool
- func (config *Config) IsAnonymousUser() bool
- func (config *Config) IsDeniedUser() bool
- func (config *Config) IsProxyAuth() bool
- func (config *Config) IsPublicKeyAuth() bool
- func (config *Config) Validate() error
- func (config *Config) ValidateForPublicKeyAuth() error
- type VersionInfo
Constants ¶
const ( // server certificate verification modes accepted by go-irodsclient. // Note that go-irodsclient only verifies the server for 'hostname'; // 'cert' behaves like 'none'. SSLVerifyServerNone string = "none" SSLVerifyServerCert string = "cert" SSLVerifyServerHostname string = "hostname" )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultLogPath ¶
func GetDefaultLogPath() string
func GetReleaseVersion ¶
func GetReleaseVersion() string
GetReleaseVersion returns release version in string
func GetVersionJSON ¶
GetVersionJSON returns VersionInfo object in JSON string
Types ¶
type Config ¶
type Config struct {
// for public key auth
IRODSProxyUsername string `envconfig:"IRODS_PROXY_USER"`
IRODSProxyPassword string `envconfig:"IRODS_PROXY_PASSWORD"`
// for iRODS auth
IRODSHost string `envconfig:"IRODS_HOST"`
IRODSPort int `envconfig:"IRODS_PORT"`
IRODSZone string `envconfig:"IRODS_ZONE"`
// IRODSAuthScheme should be one of ['native','pam','pam_for_users']
IRODSAuthScheme string `envconfig:"IRODS_AUTH_SCHEME"`
IRODSRequireCSNegotiation bool `envconfig:"IRODS_REQUIRE_CS_NEGOTIATION"`
// IRODSCSNegotiationPolicy should be one of ['CS_NEG_REFUSE','CS_NEG_REQUIRE','CS_NEG_DONT_CARE']
IRODSCSNegotiationPolicy string `envconfig:"IRODS_CS_NEGOTIATION_POLICY"`
// for irodsfs-pool
// IRODSPoolEndpoint is an optional irodsfs-pool service endpoint, e.g. "tcp://host:port", "unix:///path/to/socket" or "host:port"
IRODSPoolEndpoint string `envconfig:"IRODS_POOL_ENDPOINT"`
// for SSL/PAM auth
IRODSSSLCACertificatePath string `envconfig:"IRODS_SSL_CA_CERT_PATH"`
IRODSSSLAlgorithm string `envconfig:"IRODS_SSL_ALGORITHM"`
IRODSSSLKeySize int `envconfig:"IRODS_SSL_KEY_SIZE"`
IRODSSSLSaltSize int `envconfig:"IRODS_SSL_SALT_SIZE"`
IRODSSSLHashRounds int `envconfig:"IRODS_SSL_HASH_ROUNDS"`
// IRODSSSLVerifyServer should be one of ['none','cert','hostname'].
// Defaults to 'none', which does not verify the iRODS server certificate.
IRODSSSLVerifyServer string `envconfig:"IRODS_SSL_VERIFY_SERVER"`
// for fs mount
SFTPGoHomeDir string `envconfig:"SFTPGO_HOME_PATH"`
// SFTP args
SFTPGoAuthdUsername string `envconfig:"SFTPGO_AUTHD_USERNAME"`
SFTPGoAuthdPassword string `envconfig:"SFTPGO_AUTHD_PASSWORD"`
SFTPGoAuthdPublickey string `envconfig:"SFTPGO_AUTHD_PUBLIC_KEY"`
SFTPGoAuthdIP string `envconfig:"SFTPGO_AUTHD_IP"`
// SFTPGoAuthCacheTime is how long, in seconds, SFTPGo may reuse the result
// of a successful authentication before calling this hook again. 0 falls
// back to defaultAuthCacheTime. A revoked password or public key keeps
// working for up to this long, so the default is deliberately short.
SFTPGoAuthCacheTime int64 `envconfig:"SFTPGO_AUTH_CACHE_TIME"`
// SFTPGoDeniedUsers is a comma-separated list of user names that are
// rejected without contacting iRODS, e.g. "root,rods". Names are compared
// case-insensitively.
SFTPGoDeniedUsers string `envconfig:"SFTPGO_DENIED_USERS"`
// for Logging
SFTPGoLogDir string `envconfig:"SFTPGO_LOG_DIR"`
// for SFTPGo REST API (folder management)
SFTPGoAPIBaseURL string `envconfig:"SFTPGO_API_BASE_URL"`
SFTPGoAPIKey string `envconfig:"SFTPGO_API_KEY"`
}
Config is a configuration struct
func ReadFromEnv ¶
func (*Config) GetDeniedUsers ¶ added in v0.2.5
GetDeniedUsers returns the user names listed in SFTPGO_DENIED_USERS, with surrounding spaces trimmed and empty entries dropped.
func (*Config) GetHomeDirPath ¶ added in v0.1.7
GetHomeDirPath returns the user's iRODS home collection path, or an empty string for the anonymous user, who has no home collection. This is the only place the home path is spelled out, because the public key flow compares the path it derives from a home= option against this one.
func (*Config) GetSharedDirName ¶
GetSharedDirName returns shared dir's name
func (*Config) HasSFTPGoAPI ¶ added in v0.2.0
HasSFTPGoAPI checks if SFTPGo REST API is configured
func (*Config) HasSharedDir ¶
HasSharedDir checks if shared dir is provided
func (*Config) IsAnonymousUser ¶
IsAnonymousUser checks if the user is anonymous
func (*Config) IsDeniedUser ¶ added in v0.2.5
IsDeniedUser checks if the user is listed in SFTPGO_DENIED_USERS
func (*Config) IsProxyAuth ¶ added in v0.1.10
IsProxyAuth checks if it uses proxy auth
func (*Config) IsPublicKeyAuth ¶
IsPublicKeyAuth checks if the auth mode is public key auth
func (*Config) ValidateForPublicKeyAuth ¶
ValidateForPublicKeyAuth validates field values and returns error if occurs
type VersionInfo ¶
type VersionInfo struct {
ReleaseVersion string `json:"releaseVersion"`
GitCommit string `json:"gitCommit"`
BuildDate string `json:"buildDate"`
GoVersion string `json:"goVersion"`
Compiler string `json:"compiler"`
Platform string `json:"platform"`
}
VersionInfo object contains version related info