<p>This document describes SLURM authentication plugins and the API which defines them. It is intended as a resource to programmers wishing to write their own SLURM authentication plugins. This is version 0 of the API.</p>
<p>SLURM authentication plugins are SLURM plugins which implement the SLURM authentication API described herein. They must conform to the SLURM Plugin API with the following specifications:</p>
<p><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">const char plugin_type[]</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">- The major type must be "auth". The minor type can be any recognizable abbreviation for the type of authentication. We recommend, for example:</span></p>
<ulclass="Normal">
<listyle="margin-bottom: 0pt"><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> "none" - A plugin which implements the API without providing any actual authentication service.</span></li>
<pstyle="margin-left: 0pt; text-indent: 0in"><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">The </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">plugin_name</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> and </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">plugin_version</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> symbols required by the SLURM Plugin API require no specialization for authentication, except note carefully the versioning discussion below.</span></p>
<blockquote><spanstyle="text-position: ">The programmer is urged to study </span><spanstyle="text-position: ; font-family: 'Courier'">src/plugins/auth/auth_none.c</span><spanstyle="text-position: "> for an example implementation of a SLURM authentication plugin.</span></blockquote>
<h2>Data objects</h2>
<p>The implementation must support an opaque class, which it defines, to be used as an authentication <spanstyle="font-style: italic">credential</span>. This class must encapsulate all user-specific information necessary for the operation of the API specification below. The <spanstyle="font-style: italic">credential</span> is referred to in SLURM code by an anonymous pointer (void *).</p>
<blockquote>The implementation must maintain (though not necessarily directly export) an enumerated <spanstyle="font-style: italic">errno</span> to allow SLURM to discover as practically as possible the reason for any failed API call. The following enumerated integer values (declared in <spanstyle="font-family: 'Courier'">src/common/slurm_auth.h</span>) must be used when appropriate.</blockquote>
<blockquote>SLURM_AUTH_MEMORY - a request could not be satisfied because memory for it could not be allocated.<br>SLURM_AUTH_NOUSER - a <spanstyle="font-style: italic">credential</span> is improper because it refers to an unknown user.</blockquote>
<blockquote>SLURM_AUTH_EXPIRED - a <spanstyle="font-style: italic">credential</span> is no longer acceptable because it has expired. This does not imply that it is otherwise valid.<br>SLURM_AUTH_INVALID - a <spanstyle="font-style: italic">credential</span> is improper because the validation of it has failed. This is specifically distinct from the expiration of a <spanstyle="font-style: italic">credential</span>.<br>SLURM_AUTH_MISMATCH - a <spanstyle="font-style: italic">credential</span> could not be properly unpacked because it is of an incompatible type or version.</blockquote>
<blockquote>These values must not be used as return values in integer-valued functions in the API. The proper error return value from integer-valued functions is SLURM_ERROR. While it is most practical to associate a different <spanstyle="font-style: italic">errno</span> with each instance of a <spanstyle="font-style: italic">credential</span>, this is not necessarily enforced by the API. The implementation should endeavor to provide useful and pertinent information by whatever means is practical. In most cases this means an errno for each <spanstyle="font-style: italic">credential</span>, since plugins must be re-entrant. If a plugin maintains a global <spanstyle="font-style: italic">errno</span> in place of or in addition to a per-<spanstyle="font-style: italic">credential</span><spanstyle="font-style: italic">errno</span>, it is not required to enforce mutual exclusion on it. Successful API calls are not required to reset any <spanstyle="font-style: italic">errno</span> to a known value. However, the initial value of any <spanstyle="font-style: italic">errno</span>, prior to any error condition arising, should be SLURM_SUCCESS.</blockquote>
<blockquote>Plugins may assign implementation-specific values to <spanstyle="font-style: italic">errno</span> so long as they do not conflict with the values assigned above. This is done programmatically by assigning plugin-specific <spanstyle="font-style: italic">errno</span> values which are arithmetically greater than or equal to the symbol SLURM_AUTH_FIRST_LOCAL_ERROR.</blockquote>
<pstyle="margin-left: 36pt"><spanstyle="font-weight: bold">Description<br></span>Allocates from the free store an anonymous <spanstyle="font-style: italic">credential</span> object and returns a pointer to it. The pointer should be valid until passed to <spanstyle="font-family: 'Courier'">slurm_auth_free()</span> for disposal. The credential is not expected to be in a usable state until it is activated by <spanstyle="font-family: 'Courier'">slurm_auth_activate()</span>. SLURM will not pass <spanstyle="font-style: italic">credentials</span> to the API which have not been allocated by this function.</p>
<pstyle="margin-left: 36pt"><spanstyle="font-weight: bold">Returns<br></span>A pointer to a newly allocated credential if successful. On failure the plugin should return NULL and set its <spanstyle="font-style: italic">errno</span> to an appropriate value to indicate the reason for failure.</p>
<blockquote><spanstyle="text-position: ; font-family: 'Courier'">int slurm_auth_activate (void *cr, int secs);</span></blockquote>
<pdir="ltr"style="text-align: left; margin-bottom: 12pt; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Description<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Prepares a </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> for verification, usually by some "signing" process. </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">slurm_auth_activate() </span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">and </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">slurm_auth_verify()</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> are strictly sequential operations. A </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> which has been successfully activated should be successfully verified without any further processing, provided it has not expired. A </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> must be activated before it can be successfully verified. The return values of </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">slurm_auth_get_uid()</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> and </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">slurm_auth_get_gid()</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> may be meaningful after activation (depending on plugin preference), but are not considered trustworthy by SLURM until verification.</span></p>
<pdir="ltr"style="text-align: left; margin-bottom: 12pt; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Arguments<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">cr</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> - (input) pointer to the </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> which is to be activated. Cannot be NULL.<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">secs</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> - (input) number of seconds of wallclock time for which the </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> is to be considered valid following the call to this function. Must be a positive. Negative and zero values are reserved for future use.</span></p>
<pdir="ltr"style="text-align: left; margin-bottom: 12pt; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Returns<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">SLURM_SUCCESS if successful. On failure the function should return SLURM_ERROR and set its </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">errno</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> to an appropriate value to indicate the reason for failure.</span></p>
<blockquote><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Description<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Verifies that a </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> is in order and correctly identifies the associated user. It also verifies that the </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> has not expired. If verification is successful, the return values of </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">slurm_auth_get_uid()</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> and </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">slurm_auth_get_gid()</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> in subsequent calls must correspond to the actual verified system UID and GID of the user associated with the </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">. Verification must fail if the </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> has not previously been activated, even if a </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> implementation cannot exist in an unactivated state. A </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">'s valid term is defined at activation and verification must fail if the </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> has expired, even if it would otherwise be valid.</span></blockquote>
<pdir="ltr"style="text-align: left; margin-bottom: 0.1667in; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Arguments<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">cr</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> - (input) pointer to the </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> which is to be verified. Cannot be NULL.</span></p>
<pdir="ltr"style="text-align: left; margin-bottom: 12pt; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Returns<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">SLURM_SUCCESS if the </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> is verified to be in order and has not expired. If the </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> cannot be verified, or if the </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> has expired, the function should return SLURM_ERROR and set its </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">errno</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> to an appropriate value to indicate the reason for failure.</span></p>
<blockquote><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Description<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Extracts the numerical UID (GID) of the user corresponding to the given </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">. SLURM considers this value trustworthy only if the credential has been successfully verified using</span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt"> slurm_auth_verify()</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">. An unverified </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> does not immediately give rise to an error condition in these functions, since this would require a plugin to distinguish between a verified and an unverified </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">, which may be computationally expensive. A plugin may consider the lack of verification as an error.</span></blockquote>
<pdir="ltr"style="text-align: left; margin-bottom: 0.1667in; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Description<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Marshals a </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> into a buffer for transmission according to the SLURM packing protocol. All authentication plugins must first pack the </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">plugin_type</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> and then the </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">plugin_version</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> data before any plugin-specific data elements are packed. </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">slurm_auth_pack()</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> and </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">slurm_auth_pack()</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> are strictly reciprocal. The result of a packing followed by an unpacking must be a functionally equivalent </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">. A </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> is deemed appropriate for marshalling at any time after its allocation and before its destruction.</span></p>
<pdir="ltr"style="text-align: left; margin-bottom: 12pt; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Description<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Unmarshals a </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> from a buffer according to the SLURM packing protocol into a supplied (and presumed empty) </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> object. The unmarshalled credential is not assumed to be activated or verified. The </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">plugin_type</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> and </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">plugin_version</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> data should first be unpacked from the buffer and verified for applicability. The API does not enforce that they must be equivalent, merely compatible. Compatibility is implementation-dependent.</span></p>
<pdir="ltr"style="text-align: left; margin-bottom: 12pt; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Returns<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">SLURM_SUCCESS if the </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> was successfully unpacked. In case of failure, the function should return SLURM_ERROR and set </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">errno</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> appropriately to indicate the cause of the failure. If the function fails, no assumptions are made about the state of the credential except its suitability for destruction via </span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">slurm_auth_free()</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">.</span></p>
<pdir="ltr"style="text-align: left; margin-bottom: 12pt; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Description<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Writes a human-readable representation of the credential to a standard I/O stream. There are no strict API constraints on the behavior of this function, however it is recommended that the information be as complete and as concise as possible. For example, lengthy digital "signatures" need not be printed bitwise, but may be represented by their checksum. The intent is to provide a depiction of the </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> for debugging purposes.</span></p>
<blockquote><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Description<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Returns the current value of </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">errno</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">. Whether the value is associated with the given </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> or with the plugin as a whole is implementation-dependent. Because this function can be used to discover the reason why a credential allocation has failed, the argument is advisory. </span></blockquote>
<pdir="ltr"style="text-align: left; margin-bottom: 0.1667in; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Arguments<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt">cr</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> - (input) pointer to the </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">credential</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">, the status of whose most recently executed API function is to be returned. This value may be NULL, indicating that the most recent </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">errno</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> value applicable to the plugin as a whole is to be returned.</span></p>
<pdir="ltr"style="text-align: left; margin-bottom: 0.1667in; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Returns<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">The current value of </span><spanstyle="font-style: italic; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">errno</span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"> or SLURM_SUCCESS if there is no error to report.</span></p>
<pdir="ltr"style="text-align: left; margin-bottom: 0.0000in; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Returns<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">A pointer to a static error message. This function must always return a pointer to a string, even if the string is ambiguous such as "unknown error".</span></p>
<pdir="ltr"><spanstyle="text-position: ">This document describes version 0 of the SLURM Authentication API. Future releases of SLURM may revise this API. An authentication plugin conveys its ability to implement a particular API version using the mechanism outlined for SLURM plugins. In addition, the </span><spanstyle="font-style: italic; text-position: ">credential</span><spanstyle="text-position: "> is transmitted along with the version number of the plugin that transmitted it. It is at the discretion of the plugin author whether to maintain data format compatibility across different versions of the plugin.</span></p>
<p>A SLURM plugin is a dynamically linked code object which is loaded explicitly at runtime by the SLURM libraries. A plugin provides a customized implementation of a well-defined API connected to tasks such as authentication, interconnect fabric, and task scheduling.</p>
<h2>Identification</h2>
<p>A SLURM plugin identifies itself by a short character string formatted similarly to a MIME type: <spanstyle="font-style: italic"><major>/<minor></span>. The major type identifies which API the plugin implements. The minor type uniquely distinguishes a plugin from other plugins that implement that same API, by such means as the intended platform or the internal algorithm. For example, a plugin to interface to the Maui scheduler would give its type as "sched/maui". It would implement the SLURM Scheduler API.</p>
<h2>Versioning</h2>
<pdir="ltr"style="text-align: left; margin-bottom: 0.0000in; margin-top: 0.0000in; margin-right: 0.0000in"><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">SLURM plugin version numbers comprise a major and minor revision number. As SLURM evolves, changes to the individual plugin APIs may be necessary to implement new features. The major number identifies the version of the applicable API that the plugin implements. Incrementing the major version number denotes that the API has changed significantly and possibly incompatibly over prior versions.</span></p>
<pdir="ltr"style="text-align: left; margin-bottom: 0.0000in; margin-top: 0.0000in; margin-right: 0.0000in"><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Because plugins are separate code objects and perhaps under the control of third parties, version skew may occur in a SLURM installation. SLURM may support multiple versions of each API in a backward-compatible fashion to provide time for plugin authors to update their plugins. Conversely the plugin may support multiple versions of the API in order to be transparently portable across different SLURM installations. The version of the API spoken in an installation will be the highest-numbered version which is common to both SLURM and the plugin. Each SLURM release will document which API versions it supports. From time to time ancient API versions will be deprecated.</span></p>
<pdir="ltr"style="text-align: left; margin-bottom: 0.0000in; margin-top: 0.0000in; margin-right: 0.0000in"><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">The minor version number is incremented at the discretion of the plugin author and denotes revisions or upgrades particular to that implementation. If two or more plugins of the same type are provided in an installation, the plugin with the highest minor revision will be selected.</span></p>
<h2>Data objects</h2>
<p>A plugin must define and export the following symbols:</p>
<ulclass="Normal">
<li><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt"></span><spanstyle="font-family: 'Courier'">const char plugin_type[]</span> - a unique, short, formatted string to identify the plugin's purpose as described above. A "null" plugin (i.e., one which implements the desired API as stubs) should have a minor type of "none".</li>
<li><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt"></span><spanstyle="font-family: 'Courier'">const char plugin_name[] </span>- a free-form string which identifies the plugin in human-readable terms, such as "Kerberos authentication". SLURM will use this string to identify the plugin to end users.</li>
<li><spanstyle="text-position: ; color:#000000; font-family: 'Courier'; font-size: 12.000000pt"></span><spanstyle="font-family: 'Courier'">const uint32_t plugin_version</span> - a 32-bit unsigned integer giving the version of the plugin as described above. The major revision number is multiplied by 1,000 and added to the minor revision number to produce the integer value. Thus a plugin with a major revision number of 2 and a minor revision number of 35 will have a <spanstyle="font-family: 'Courier'">plugin_version</span> value of 2035.</li>
</ul>
<pstyle="margin-left: 0pt; text-indent: 0in">A plugin may optionally define and export the following symbols:</p>
<ulclass="Normal">
<li><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt"></span><spanstyle="font-family: 'Courier'">const uint32_t plugin_legacy</span> - a 32-bit unsigned integer formatted the same as <spanstyle="font-family: 'Courier'">plugin_version</span> giving the lowest API version number with which this plugin is compatible. If this symbol is omitted its value is assumed to be equivalent to the <spanstyle="font-family: 'Courier'">plugin_version</span><spanstyle="font-family: 'Nimbus Roman'"> rounded to the next lowest 1,000.</span> Only the major version number of this symbol is significant.</li>
<pdir="ltr"style="text-align: left; margin-bottom: 0.1667in; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Description<br></span><spanstyle="text-position: ; font-family: 'Nimbus Roman'; font-size: 12.000000pt">If present, this function is called just after the plugin is loaded. This allows the plugin to perform any global initialization prior to any actual API calls.</span></p>
<pdir="ltr"style="text-align: left; margin-bottom: 0.1667in; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Returns<br></span><spanstyle="text-position: ; font-family: 'Nimbus Roman'; font-size: 12.000000pt">SLURM_SUCCESS if the plugin's initialization was successful. Any other return value indicates to SLURM that the plugin should be unloaded and not used.</span></p>
<pdir="ltr"style="text-align: left; margin-bottom: 0.1667in; margin-top: 0.0000in; margin-right: 0.0000in; margin-left: 0.5000in"><spanstyle="font-weight: bold; text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">Description<br></span><spanstyle="text-position: ; color:#000000; font-family: 'Nimbus Roman'; font-size: 12.000000pt">If present, this function is called just before the plugin is unloaded. This allows the plugin to do any finalization after the last plugin-specific API call is made.</span></p>
<pdir="ltr"style="text-align: left; margin-bottom: 0.1667in; margin-top: 0.0000in; margin-right: 0.0000in">N.B. these functions are not the same as those described in the <spanstyle="font-family: 'Courier'">dlopen(3)</span> system library. The C runtime system co-opts those symbols for its own initialization. The system <spanstyle="font-family: 'Courier'">init()</span> is called before the SLURM plugin <spanstyle="font-family: 'Courier'">init()</span>, and the <spanstyle="font-family: 'Courier'">SLURM fini()</span> is called before the system's <spanstyle="font-family: 'Courier'">fini()</span>.</p>
<pstyle="margin-left: 0pt">The functions need not appear. The plugin may provide either <spanstyle="font-family: 'Courier'">init()</span> or <spanstyle="font-family: 'Courier'">fini()</span> or both.</p>
<h2>Thread safety</h2>
<p>SLURM is a multithreaded application. The SLURM plugin library may exercise the plugin functions in a re-entrant fashion. It is the responsibility of the plugin author to provide the necessarily mutual exclusion and synchronization in order to avoid the pitfalls of re-entrant code.</p>
<h2>Runtime support</h2>
<p>The standard system libraries are available to the plugin. The SLURM libraries are also available and plugin authors are encouraged to make use of them rather than develop their own substitutes. Plugins should use the SLURM log to print error messages.</p>
<p>The plugin author is responsible for specifying any specific non-standard libraries needed for correct operation. Plugins will not load if their dependent libraries are not available, so it is the installer's job to make sure the specified libraries are available.</p>