OAuth validator modules are dynamically loaded from the shared
libraries listed in <xref linkend="guc-oauth-validator-libraries"/>.
Modules are loaded on demand when requested from a login in progress.
The normal library search path is used to locate the library. To
provide the validator callbacks and to indicate that the library is an OAuth
validator module a function named
<function>_PG_oauth_validator_module_init</function> must be provided. The
return value of the function must be a pointer to a struct of type
<structname>OAuthValidatorCallbacks</structname>, which contains a magic
number and pointers to the module's token validation functions. The returned
pointer must be of server lifetime, which is typically achieved by defining
it as a <literal>static const</literal> variable in global scope.
《機械翻訳》OAuthバリデータモジュールは、oauth_validator_librariesにリストされている共有ライブラリから動的にロードされます。
モジュールは、進行中のログインからリクエストされたときにオンデマンドでロードされます。
通常のライブラリ検索パスは、ライブラリの位置を特定するために使用されます。
バリデータコールバックを提供し、ライブラリがOAuthバリデータモジュールであることを示すには、関数記名的を指定する必要があります_PG_OAuth_validator_module_init
指定する必要があります。
関数の戻り値は、タイプの構造体OAuthValidatorCallbacks
へのポインタである必要があります。
の構造体は包含マジックナンバーであり、モジュールのトークンバリデーション関数へのポインタです。
戻されるポインタの存続期間はサーバである必要があります。
これは通常、グローバル・スコープのstatic const
変数として定義することで実現されます。
typedef struct OAuthValidatorCallbacks { uint32 magic; /* must be set to PG_OAUTH_VALIDATOR_MAGIC */ ValidatorStartupCB startup_cb; ValidatorShutdownCB shutdown_cb; ValidatorValidateCB validate_cb; } OAuthValidatorCallbacks; typedef const OAuthValidatorCallbacks *(*OAuthValidatorModuleInit) (void);
Only the <function>validate_cb</function> callback is required, the others
are optional.
《機械翻訳》validate_cb
コールバックのみ必須、他はオプショナルです。