Documentation ¶
Index ¶
- Variables
- func AddQueryValues(s string, qs url.Values) (string, error)
- func CalcSHA256(buf []byte) []byte
- func CalcSHA256Hex(buf []byte) (hexStr string)
- func CheckObjectName(objectName string) bool
- func CloseResponse(resp *http.Response)
- func DecodeURIComponent(s string) (string, error)
- func EncodePath(pathName string) string
- func GetContentLength(reader io.Reader) (int64, error)
- func GetECPieceSize(payloadSize uint64, segmentIdx uint32, maxSegmentSize uint64, ...) int64
- func GetEndpointURL(endpoint string, secure bool) (*url.URL, error)
- func GetSegmentCount(payloadSize uint64, maxSegmentSize uint64) uint32
- func GetSegmentSize(payloadSize uint64, segmentIdx uint32, maxSegmentSize uint64) int64
- func IsDomainNameValid(hostName string) bool
- func IsIPValid(ip string) bool
- func IsSQLInjection(input string) bool
- func IsValidObjectPrefix(prefix string) bool
- func NewPrincipalWithAccount(principalAddr sdk.AccAddress) (types.Principal, error)
- func NewPrincipalWithGroupId(groupId uint64) (types.Principal, error)
- func NewStatement(actions []permTypes.ActionType, effect permTypes.Effect, resource []string, ...) permTypes.Statement
- func ParseRange(rangeStr string) (bool, int64, int64)
- func ReadFull(r io.Reader, buf []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
var EmptyURL = url.URL{}
Functions ¶
func AddQueryValues ¶
AddQueryValues adds queryValue to url
func CalcSHA256 ¶
CalcSHA256 computes checksum of sha256 from byte array
func CalcSHA256Hex ¶
CalcSHA256Hex computes checksum of sha256 hash and encode it to hex
func CheckObjectName ¶ added in v1.6.0
CheckObjectName This code block checks for unsupported or potentially risky formats in object names. The checks are essential for ensuring the security and compatibility of the object names within the system. 1. ".." in object names: Checked to prevent path traversal attacks which might access directories outside the intended scope. 2. Object name being "/": The root directory should not be used as an object name due to potential security risks and ambiguity. 3. "\\" in object names: Backslashes are checked because they are often not supported in UNIX-like file systems and can cause issues in path parsing. 4. SQL Injection patterns in object names: Ensures that the object name does not contain patterns that could be used for SQL injection attacks, maintaining the integrity of the database.
func DecodeURIComponent ¶
func EncodePath ¶
EncodePath encodes the strings from UTF-8 byte representations to HTML hex escape sequences
func GetContentLength ¶
GetContentLength returns the size of reader
func GetECPieceSize ¶ added in v0.2.3
func GetEndpointURL ¶
GetEndpointURL - constructs a new endpoint.
func GetSegmentCount ¶ added in v0.2.3
func GetSegmentSize ¶ added in v0.2.3
func IsDomainNameValid ¶
IsDomainNameValid validates if input string is a valid domain name.
func IsSQLInjection ¶ added in v1.6.0
func IsValidObjectPrefix ¶
IsValidObjectPrefix checks if the given object prefix is valid: - does not have invalid path segments - is a valid UTF-8 string - does not contain double slashes "//"
func NewPrincipalWithAccount ¶
func NewPrincipalWithAccount(principalAddr sdk.AccAddress) (types.Principal, error)
NewPrincipalWithAccount return the marshaled Principal string which indicates the account
func NewPrincipalWithGroupId ¶
NewPrincipalWithGroupId return the marshaled Principal string which indicates the group
func NewStatement ¶
func NewStatement(actions []permTypes.ActionType, effect permTypes.Effect, resource []string, opts types.NewStatementOptions, ) permTypes.Statement
NewStatement return the statement of permission module
Types ¶
This section is empty.