package
0.0.0-20240917120716-8843776e9f3a
Repository: https://github.com/cossacklabs/acra.git
Documentation: pkg.go.dev
# Functions
FindColumnInfo get ColumnInfo from TableExprs, ColName and TableSchemaStore.
GetColumnSetting get ColumnEncryptionSetting from schemaStore based on tableName and column.
GetTablesWithAliases collect all tables from all update TableExprs which may be as subquery/table/join/etc collect only table names and ignore aliases for subqueries.
GetWhereStatements parse all Where expressions.
MapColumnsToAliases parse slice of ColumnInfo from sqlparser.Select and config.TableSchemaStore.
NewAliasToTableMapFromTables create AliasToTableMap from slice of aliased tables.
NewArrayClientIDObservableManager create new ArrayClientIDObservableManager.
NewArrayQueryObservableManager create new ArrayQueryObservableManager.
NewOnQueryObjectFromQuery return OnQueryObject with query string as value.
NewOnQueryObjectFromStatement return OnQueryObject with Statement as value.
NewQueryEncryptor create QueryDataEncryptor with DBDataCoder.
NewSearchableQueryFilter create new SearchableQueryFilter from schemaStore and SearchableQueryFilterMode.
ParseQuerySettings parse list of select query settings based on schemaStore.
ParseSearchQueryPlaceholdersSettings parse encryption settings of statement with placeholders.
PgEncodeToHexString encodes to hex with \x prefix.
UpdateExpressionValue decode value from DB related string to binary format, call updateFunc, encode to DB string format and replace value in expression with new.
# Constants
InvalidPlaceholderIndex value that represent invalid index for sql placeholders.
SubstrFuncName substr function name.
# Variables
ErrInvalidPlaceholder is returned when Acra cannot parse SQL placeholder expression.
ErrUnsupportedQueryType represent error related unsupported Query type.
ErrUpdateLeaveDataUnchanged show that data wasn't changed in UpdateExpressionValue with updateFunc.
# Structs
AliasedTableName store TableName and related As value together.
ArrayClientIDObservableManager store all subscribed observes and call sequentially OnQuery on each observer.
ArrayQueryObservableManager store all subscribed observes and call sequentially OnQuery on each observer.
PgQueryDBDataCoder responsible to handle decoding/encoding SQL literals before/after QueryEncryptor handlers
Acra captures SQL queries like `INSERT INTO users (age, username, email, photo) VALUES (123, 'john_wick', '[email protected]', '\xaabbcc');` and manipulates with SQL values `123`, `'john_wick'`, `'[email protected]'`, `'\xaabbcc'`.
QueryDataEncryptor parse query and encrypt raw data according to TableSchemaStore.
SearchableExprItem represent the filtered value found by SearchableQueryFilter.
SearchableQueryFilter filter searchable expression based on SearchableQueryFilterMode.
# Interfaces
ClientIDObservable used to subscribe for clientID changes.
ClientIDObservableManager used to subscribe for clientID changes and notify about changes.
ClientIDObserver used to notify subscribers about changed ClientID in encryption/decryption context.
OnQueryObject interface for result of OnQuery call.
QueryObservable used to handle subscribers for new incoming queries.
QueryObserver observes database queries and is able to modify them.
QueryObserverManager interface for observer aggregations.
# Type aliases
AliasToTableMap store table alias as key and table name as value.