Slurm Authentication Plugin API

Overview

This document describes Slurm authentication plugins and the API that defines them.
このドキュメントでは、Slurm認証プラグインとそれらを定義するAPIについて説明します。
It is intended as a resource to programmers wishing to write their own Slurm authentication plugins.
これは、独自のSlurm認証プラグインを作成したいプログラマー向けのリソースとして意図されています。

Slurm authentication plugins are Slurm plugins that implement the Slurm authentication API described herein.
Slurm認証プラグインは、ここで説明するSlurm認証APIを実装するSlurmプラグインです。
They must conform to the Slurm Plugin API with the following specifications:
これらは、次の仕様のSlurmプラグインAPIに準拠している必要があります。

const char plugin_type[]
The major type must be "auth." The minor type can be any recognizable abbreviation for the type of authentication.
メジャータイプは「auth」である必要があります。マイナータイプは、認証のタイプの認識可能な省略形にすることができます。
We recommend, for example:
たとえば、次のことをお勧めします。

  • none — A plugin that implements the API without providing any actual authentication service.
    none —実際の認証サービスを提供せずにAPIを実装するプラグイン。
    This may be used for testing purposes, but is not suitable for production use due to lack of effective security.
    これはテスト目的で使用できますが、効果的なセキュリティがないため、本番環境での使用には適していません。
  • munge — LLNL's Munge protocol (recommended plugin for production use).
    munge — LLNLのMungeプロトコル(本番環境での使用に推奨されるプラグイン)。

const char plugin_name[]
Some descriptive name for the plugin.
プラグインのわかりやすい名前。
There is no requirement with respect to its format.
そのフォーマットに関する要件はありません。

const uint32_t plugin_version
If specified, identifies the version of Slurm used to build this plugin and any attempt to load the plugin from a different version of Slurm will result in an error.
指定されている場合、このプラグインのビルドに使用されたSlurmのバージョンを識別し、異なるバージョンのSlurmからプラグインをロードしようとするとエラーが発生します。
If not specified, then the plugin may be loaded by Slurm commands and daemons from any version, however this may result in difficult to diagnose failures due to changes in the arguments to plugin functions or changes in other Slurm functions used by the plugin.
指定しない場合、プラグインは任意のバージョンのSlurmコマンドおよびデーモンによってロードされる可能性がありますが、プラグイン関数の引数の変更またはプラグインが使用する他のSlurm関数の変更により、障害の診断が困難になる可能性があります。

The programmer is urged to study src/plugins/auth/none/auth_none.c for an example implementation of a Slurm authentication plugin.
プログラマーは、Slurm認証プラグインの実装例について、src / plugins / auth / none /auth_none.cを調べることをお勧めします。

Data Objects

The implementation must support an opaque class, which it defines, to be used as an authentication "credential." This class must encapsulate all user-specific information necessary for the operation of the API specification below.
実装は、認証の「資格情報」として使用されるために、それが定義する不透明なクラスをサポートする必要があります。このクラスは、以下のAPI仕様の操作に必要なすべてのユーザー固有の情報をカプセル化する必要があります。
The credential is referred to in Slurm code by an anonymous pointer (void *).
資格情報は、Slurmコードで匿名ポインター(void *)によって参照されます。

API Functions

The following functions must appear.
次の関数が表示される必要があります。
Functions which are not implemented should be stubbed.
実装されていない関数はスタブする必要があります。

int init (void)

Description:
Called when the plugin is loaded, before any other functions are called.
プラグインがロードされたときに、他の関数が呼び出される前に呼び出されます。
Put global initialization here.
ここにグローバル初期化を配置します。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

void fini (void)

Description:
Called when the plugin is removed. Clear any allocated storage here.
プラグインが削除されたときに呼び出されます。ここで割り当てられたストレージをすべてクリアします。

Returns: None.

Note: These init and fini functions are not the same as those described in the dlopen (3) system library.
注:これらのinitおよびfini関数は、dlopen(3)システムライブラリで説明されているものと同じではありません。
The C run-time system co-opts those symbols for its own initialization.
Cランタイムシステムは、独自の初期化のためにこれらのシンボルを採用します。
The system _init() is called before the Slurm init(), and the Slurm fini() is called before the system's _fini().
システム_init()はSlurm init()の前に呼び出され、Slurm fini()はシステムの_fini()の前に呼び出されます。

void *slurm_auth_create(char *auth_info);

Description: Allocates from the free store an anonymous credential object and returns a pointer to it.
説明:フリーストアから匿名の資格情報オブジェクトを割り当て、そのオブジェクトへのポインタを返します。
The pointer should be valid until passed to slurm_auth_destroy() for disposal.
ポインタは、破棄のためにslurm_auth_destroy()に渡されるまで有効である必要があります。
Slurm will not pass credentials to the API which have not been allocated by this function.
Slurmは、この関数によって割り当てられていない資格情報をAPIに渡しません。

Arguments:
argv   (input) plugin specific information.
argv(入力)プラグイン固有の情報。
auth_info   (input) plugin specific identification of the server.
サーバーのauth_info(入力)プラグイン固有のID。

Returns: A pointer to a newly allocated credential if successful.
戻り値:成功した場合、新しく割り当てられた資格情報へのポインター。
On failure, the plugin should return NULL and set its errno to an appropriate value to indicate the reason for failure.
失敗した場合、プラグインはNULLを返し、失敗の理由を示すためにerrnoを適切な値に設定する必要があります。

int slurm_auth_destroy (void *cr);

Description: Deallocates a credential that was allocated with slurm_auth_alloc() and any associated storage that has been allocated for it during its use.
説明:slurm_auth_alloc()で割り当てられた資格情報と、その使用中に割り当てられた関連ストレージの割り当てを解除します。

Arguments: cr    (input) pointer to the credential that is to be deallocated.
引数:割り当て解除される資格情報へのcr(入力)ポインター。
Cannot be NULL.
NULLにすることはできません。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
失敗した場合、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して失敗の理由を示す必要があります。

int slurm_auth_verify (void *cr, char *auth_info );

Description: Verifies that a credential is in order and correctly identifies the associated user.
説明:資格情報が正常であることを確認し、関連付けられたユーザーを正しく識別します。
It also verifies that the credential has not expired.
また、資格情報の有効期限が切れていないことも確認します。
If verification is successful, the return values of slurm_auth_get_uid() and slurm_auth_get_gid() in subsequent calls must correspond to the actual verified system UID and GID of the user associated with the credential.
検証が成功した場合、後続の呼び出しでのslurm_auth_get_uid()およびslurm_auth_get_gid()の戻り値は、資格情報に関連付けられたユーザーの実際の検証済みシステムUIDおよびGIDに対応している必要があります。
Verification must fail if the credential has not previously been activated, even if a credential implementation cannot exist in an unactivated state.
資格情報の実装が非アクティブ化された状態で存在できない場合でも、資格情報が以前にアクティブ化されていない場合は、検証に失敗する必要があります。
A credential's valid term is defined at activation and verification must fail if the credential has expired, even if it would otherwise be valid.
資格情報の有効期間はアクティブ化時に定義され、資格情報の有効期限が切れている場合は、それ以外の場合は有効であっても、検証に失敗する必要があります。

Arguments:
cr   (input) pointer to the credential which is to be verified.
cr(入力)検証される資格情報へのポインター。
Cannot be NULL.
NULLにすることはできません。

auth_info   (input) plugin specific identification of the server.
サーバーのauth_info(入力)プラグイン固有のID。

Returns: SLURM_SUCCESS if the credential is verified to be in order and has not expired.
戻り値:資格情報が正常であることが確認され、有効期限が切れていない場合は、SLURM_SUCCESS。
If the credential cannot be verified, or if the credential has expired, the function should return SLURM_ERROR and set its errno to an appropriate value to indicate the reason for failure.
資格情報を検証できない場合、または資格情報の有効期限が切れている場合、関数はSLURM_ERRORを返し、失敗の理由を示すためにerrnoを適切な値に設定する必要があります。

uid_t slurm_auth_get_uid(void *cred);
gid_t slurm_auth_get_gid (void *cred);

Description: Extracts the numerical UID or GID of the user corresponding to the given credential.
説明:指定された資格情報に対応するユーザーの数値UIDまたはGIDを抽出します。
Only valid after slurm_auth_verify() has been called on a given credential.
特定の資格情報でslurm_auth_verify()が呼び出された後にのみ有効です。
An unverified credential does not immediately give rise to an error condition in these functions, but instead will return SLURM_AUTH_NOBODY for the UID and GID.
未確認の資格情報は、これらの関数ですぐにエラー状態を引き起こすわけではありませんが、代わりにUIDとGIDに対してSLURM_AUTH_NOBODYを返します。
A plugin may consider the lack of verification as an error.
プラグインは、検証の欠如をエラーと見なす場合があります。

Arguments:
cred    (input) pointer to the credential containing the desired identification.
cred(入力)目的のIDを含む資格情報へのポインター。
Cannot be NULL.
NULLにすることはできません。

Returns: If successful, the Linux UID (GID) associated with the credential.
戻り値:成功した場合、資格情報に関連付けられたLinux UID(GID)。
In case of error, SLURM_AUTH_NOBODY should be returned and errno set appropriately to indicate the cause of the failure.
エラーが発生した場合は、SLURM_AUTH_NOBODYを返し、エラーの原因を示すためにerrnoを適切に設定する必要があります。

int slurm_auth_pack (void *cr, Buf buf);

Description: Marshals a credential into a buffer for transmission according to the Slurm packing protocol.
説明:Slurmパッキングプロトコルに従って、送信用の資格情報をバッファーにマーシャリングします。
All authentication plugins must first pack the plugin_type and then the plugin_version data before any plugin-specific data elements are packed.
すべての認証プラグインは、プラグイン固有のデータ要素をパックする前に、最初にplugin_typeをパックし、次にplugin_versionデータをパックする必要があります。
slurm_auth_pack() and slurm_auth_pack() are strictly reciprocal.
slurm_auth_pack()とslurm_auth_pack()は厳密に相互です。
The esult of a packing followed by an unpacking must be a functionally equivalent credential.
パッキングとそれに続くアンパッキングの結果は、機能的に同等の資格情報である必要があります。
A credential is deemed appropriate for marshalling at any time after its allocation and before its destruction.
資格情報は、割り当て後、破棄される前であればいつでもマーシャリングに適していると見なされます。

Arguments:
cr    (input) pointer to the credential to pack.
パックする資格情報へのcr(入力)ポインター。

buf    (input/output) the buffer into which the credential should be packed.
buf(入力/出力)資格情報をパックする必要のあるバッファー。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure the plugin should return SLURM_ERROR and set the errno to indicate the reason for the failure.
失敗すると、プラグインはSLURM_ERRORを返し、失敗の理由を示すためにerrnoを設定する必要があります。

int slurm_auth_unpack (void *cr, Buf buf);

Description: Unmarshals a credential from a buffer according to the Slurm packing protocol into a supplied (and presumed empty) credential object.
説明:Slurmパッキングプロトコルに従って、バッファーから提供された(そして空であると推定される)資格情報オブジェクトに資格情報をアンマーシャルします。
The unmarshalled credential is not assumed to be activated or verified.
マーシャリングされていない資格情報は、アクティブ化または検証されているとは見なされません。
The plugin_type and plugin_version data should first be unpacked from the buffer and verified for applicability.
plugin_typeおよびplugin_versionデータを最初にバッファーから解凍し、適用可能性を確認する必要があります。
The API does not enforce that they must be equivalent, merely compatible.
APIは、それらが同等である必要があることを強制するものではなく、単に互換性があるだけです。
Compatibility is implementation-dependent.
互換性は実装に依存します。

Arguments:
cr    (output) pointer to the credential to pack.
パックする資格情報へのcr(出力)ポインター。

buf    (input/output) the buffer from which the credential should be unpacked.
buf(入力/出力)資格情報を解凍するバッファー。

Returns: SLURM_SUCCESS if the credential was successfully unpacked.
戻り値:資格情報が正常に解凍された場合はSLURM_SUCCESS。
In case of failure, the function should return SLURM_ERROR and set errno appropriately to indicate the cause of the failure.
失敗した場合、関数はSLURM_ERRORを返し、エラーの原因を示すためにerrnoを適切に設定する必要があります。
If the function fails, no assumptions are made about the state of the credential except its suitability for destruction via slurm_auth_destroy().
関数が失敗した場合、slurm_auth_destroy()による破棄への適合性を除いて、資格情報の状態についての仮定は行われません。

Last modified 7 March 2019