#include "postgres.h"
#include <unistd.h>
#include <fcntl.h>
#include "common/oauth-common.h"
#include "fmgr.h"
#include "lib/stringinfo.h"
#include "libpq/auth.h"
#include "libpq/hba.h"
#include "libpq/oauth.h"
#include "libpq/sasl.h"
#include "storage/fd.h"
#include "storage/ipc.h"
#include "utils/json.h"
#include "utils/varlena.h"
Go to the source code of this file.
Definition at line 80 of file auth-oauth.c.
Definition at line 81 of file auth-oauth.c.
Definition at line 79 of file auth-oauth.c.
Enumerator | |
---|---|
OAUTH_STATE_INIT | |
OAUTH_STATE_ERROR | |
OAUTH_STATE_FINISHED |
Definition at line 57 of file auth-oauth.c.
Definition at line 820 of file auth-oauth.c.
References ereport, errcode(), errcontext, errmsg(), foreach_ptr, List::length, HbaLine::linenumber, linitial, list_free_deep(), NIL, HbaLine::oauth_validator, oauth_validator_libraries_string, pfree(), psprintf(), pstrdup(), HbaLine::sourcefile, and SplitDirectoriesString().
Referenced by parse_hba_line().
Definition at line 485 of file auth-oauth.c.
References appendStringInfoString(), buf, ereport, errcode(), errdetail_log(), errmsg(), escape_json(), FATAL, initStringInfo(), oauth_ctx::issuer, output, pfree(), and oauth_ctx::scope.
Referenced by oauth_exchange().
Definition at line 738 of file auth-oauth.c.
References Assert(), CurrentMemoryContext, ereport, errdetail(), errmsg(), ERROR, MemoryContextCallback::func, load_external_function(), OAuthValidatorCallbacks::magic, MemoryContextRegisterResetCallback(), palloc0(), PG_OAUTH_VALIDATOR_MAGIC, shutdown_validator_library(), OAuthValidatorCallbacks::startup_cb, ValidatorModuleState::sversion, OAuthValidatorCallbacks::validate_cb, validator_module_state, and ValidatorCallbacks.
Referenced by oauth_init().
Definition at line 134 of file auth-oauth.c.
References Assert(), elog, ereport, errcode(), errdetail(), errmsg(), ERROR, explicit_bzero(), generate_error_response(), input, KVSEP, OAUTH_STATE_ERROR, OAUTH_STATE_FINISHED, OAUTH_STATE_INIT, output, parse_kvpairs_for_auth(), PG_SASL_EXCHANGE_CONTINUE, PG_SASL_EXCHANGE_FAILURE, PG_SASL_EXCHANGE_SUCCESS, oauth_ctx::port, pstrdup(), sanitize_char(), oauth_ctx::state, and validate().
Definition at line 89 of file auth-oauth.c.
References appendStringInfoChar(), appendStringInfoString(), buf, and OAUTHBEARER_NAME.
Definition at line 102 of file auth-oauth.c.
References Assert(), ereport, errcode(), errmsg(), ERROR, oauth_ctx::issuer, load_validator_library(), OAUTH_STATE_INIT, OAUTHBEARER_NAME, palloc0(), oauth_ctx::port, port, oauth_ctx::scope, and oauth_ctx::state.
Definition at line 386 of file auth-oauth.c.
References AUTH_KEY, ereport, errcode(), errdetail(), errmsg(), ERROR, input, sort-test::key, KVSEP, pg_unreachable, validate_kvpair(), and value.
Referenced by oauth_exchange().
Definition at line 806 of file auth-oauth.c.
References OAuthValidatorCallbacks::shutdown_cb, validator_module_state, and ValidatorCallbacks.
Referenced by load_validator_library().
Definition at line 638 of file auth-oauth.c.
References ClientConnectionInfo::authn_id, ValidatorModuleResult::authn_id, ValidatorModuleResult::authorized, check_usermap(), cleanup(), ereport, errcode(), errdetail_log(), errmsg(), FATAL, LOG, MyClientConnectionInfo, palloc0(), pfree(), port, set_authn_id(), STATUS_OK, token, OAuthValidatorCallbacks::validate_cb, validate_token_format(), validator_module_state, ValidatorCallbacks, and WARNING.
Referenced by attribute_reloptions(), bloptions(), brinoptions(), btoptions(), build_local_reloptions(), build_reloptions(), default_reloptions(), dioptions(), fillRelOptions(), ginoptions(), gistoptions(), hashoptions(), heap_reloptions(), index_opclass_options(), index_reloptions(), oauth_exchange(), parse_one_reloption(), parseLocalRelOptions(), parseRelOptions(), parseRelOptionsInternal(), partitioned_table_reloptions(), spgoptions(), tablespace_reloptions(), and view_reloptions().
Definition at line 327 of file auth-oauth.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, sort-test::key, and val.
Referenced by parse_kvpairs_for_auth().
Definition at line 556 of file auth-oauth.c.
References Assert(), BEARER_SCHEME, COMMERROR, ereport, errcode(), errdetail_log(), errmsg(), pg_strncasecmp(), and token.
Referenced by validate().
Definition at line 34 of file auth-oauth.c.
Referenced by check_oauth_validator().
Definition at line 48 of file auth-oauth.c.
Referenced by ClientAuthentication().
Definition at line 44 of file auth-oauth.c.
Referenced by load_validator_library(), shutdown_validator_library(), and validate().
Definition at line 45 of file auth-oauth.c.
Referenced by load_validator_library(), shutdown_validator_library(), and validate().