/* *Startupcallback,tosetupprivatedataforthevalidator.
*/ staticvoid
validator_startup(ValidatorModuleState *state)
{ /* *Makesuretheserveriscorrectlysettingsversion.(Realmodules *shouldnotdothis;itwoulddefeatupgradecompatibility.)
*/ if (state->sversion != PG_VERSION_NUM)
elog(ERROR, "oauth_validator: sversion set to %d", state->sversion);
state->private_data = PRIVATE_COOKIE;
}
/* *Shutdowncallback,toteardownthevalidator.
*/ staticvoid
validator_shutdown(ValidatorModuleState *state)
{ /* Check to make sure our private state still exists. */ if (state->private_data != PRIVATE_COOKIE)
elog(PANIC, "oauth_validator: private state cookie changed to %p in shutdown",
state->private_data);
}
/* *Validatorimplementation.Logstheincomingdataandauthorizesthetokenby *default;thebehaviorcanbemodifiedviathemodule'sGUCsettings.
*/ staticbool
validate_token(const ValidatorModuleState *state, constchar *token, constchar *role,
ValidatorModuleResult *res)
{ /* Check to make sure our private state still exists. */ if (state->private_data != PRIVATE_COOKIE)
elog(ERROR, "oauth_validator: private state cookie changed to %p in validate",
state->private_data);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.