cassandra-server
Version:
A thin Javascript wrapper around Apache Cassandra to provide out of the box server support
476 lines (474 loc) • 23.4 kB
HTML
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_67) on Sun Sep 07 15:29:29 CEST 2014 -->
<title>IAuthenticator (apache-cassandra API)</title>
<meta name="date" content="2014-09-07">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="IAuthenticator (apache-cassandra API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/IAuthenticator.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/auth/DataResource.html" title="class in org.apache.cassandra.auth"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/auth/IAuthenticator.Option.html" title="enum in org.apache.cassandra.auth"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/auth/IAuthenticator.html" target="_top">Frames</a></li>
<li><a href="IAuthenticator.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested_class_summary">Nested</a> | </li>
<li><a href="#field_summary">Field</a> | </li>
<li>Constr | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li>Constr | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.cassandra.auth</div>
<h2 title="Interface IAuthenticator" class="title">Interface IAuthenticator</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Subinterfaces:</dt>
<dd><a href="../../../../org/apache/cassandra/auth/ISaslAwareAuthenticator.html" title="interface in org.apache.cassandra.auth">ISaslAwareAuthenticator</a></dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../org/apache/cassandra/auth/AllowAllAuthenticator.html" title="class in org.apache.cassandra.auth">AllowAllAuthenticator</a>, <a href="../../../../org/apache/cassandra/auth/LegacyAuthenticator.html" title="class in org.apache.cassandra.auth">LegacyAuthenticator</a>, <a href="../../../../org/apache/cassandra/auth/PasswordAuthenticator.html" title="class in org.apache.cassandra.auth">PasswordAuthenticator</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="strong">IAuthenticator</span></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested_class_summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Interface and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/auth/IAuthenticator.Option.html" title="enum in org.apache.cassandra.auth">IAuthenticator.Option</a></strong></code>
<div class="block">Supported CREATE USER/ALTER USER options.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/auth/IAuthenticator.html#PASSWORD_KEY">PASSWORD_KEY</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/auth/IAuthenticator.html#USERNAME_KEY">USERNAME_KEY</a></strong></code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/auth/IAuthenticator.html#alter(java.lang.String,%20java.util.Map)">alter</a></strong>(java.lang.String username,
java.util.Map<<a href="../../../../org/apache/cassandra/auth/IAuthenticator.Option.html" title="enum in org.apache.cassandra.auth">IAuthenticator.Option</a>,java.lang.Object> options)</code>
<div class="block">Called during execution of ALTER USER query.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.util.Set<<a href="../../../../org/apache/cassandra/auth/IAuthenticator.Option.html" title="enum in org.apache.cassandra.auth">IAuthenticator.Option</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/auth/IAuthenticator.html#alterableOptions()">alterableOptions</a></strong>()</code>
<div class="block">Subset of supportedOptions that users are allowed to alter when performing ALTER USER [themselves].</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/cassandra/auth/AuthenticatedUser.html" title="class in org.apache.cassandra.auth">AuthenticatedUser</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/auth/IAuthenticator.html#authenticate(java.util.Map)">authenticate</a></strong>(java.util.Map<java.lang.String,java.lang.String> credentials)</code>
<div class="block">Authenticates a user given a Map<String, String> of credentials.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/auth/IAuthenticator.html#create(java.lang.String,%20java.util.Map)">create</a></strong>(java.lang.String username,
java.util.Map<<a href="../../../../org/apache/cassandra/auth/IAuthenticator.Option.html" title="enum in org.apache.cassandra.auth">IAuthenticator.Option</a>,java.lang.Object> options)</code>
<div class="block">Called during execution of CREATE USER query (also may be called on startup, see seedSuperuserOptions method).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/auth/IAuthenticator.html#drop(java.lang.String)">drop</a></strong>(java.lang.String username)</code>
<div class="block">Called during execution of DROP USER query.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.util.Set<? extends <a href="../../../../org/apache/cassandra/auth/IResource.html" title="interface in org.apache.cassandra.auth">IResource</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/auth/IAuthenticator.html#protectedResources()">protectedResources</a></strong>()</code>
<div class="block">Set of resources that should be made inaccessible to users and only accessible internally.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/auth/IAuthenticator.html#requireAuthentication()">requireAuthentication</a></strong>()</code>
<div class="block">Whether or not the authenticator requires explicit login.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/auth/IAuthenticator.html#setup()">setup</a></strong>()</code>
<div class="block">Setup is called once upon system startup to initialize the IAuthenticator.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.util.Set<<a href="../../../../org/apache/cassandra/auth/IAuthenticator.Option.html" title="enum in org.apache.cassandra.auth">IAuthenticator.Option</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/auth/IAuthenticator.html#supportedOptions()">supportedOptions</a></strong>()</code>
<div class="block">Set of options supported by CREATE USER and ALTER USER queries.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/cassandra/auth/IAuthenticator.html#validateConfiguration()">validateConfiguration</a></strong>()</code>
<div class="block">Validates configuration of IAuthenticator implementation (if configurable).</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="USERNAME_KEY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>USERNAME_KEY</h4>
<pre>static final java.lang.String USERNAME_KEY</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.cassandra.auth.IAuthenticator.USERNAME_KEY">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="PASSWORD_KEY">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>PASSWORD_KEY</h4>
<pre>static final java.lang.String PASSWORD_KEY</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.cassandra.auth.IAuthenticator.PASSWORD_KEY">Constant Field Values</a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="requireAuthentication()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>requireAuthentication</h4>
<pre>boolean requireAuthentication()</pre>
<div class="block">Whether or not the authenticator requires explicit login.
If false will instantiate user with AuthenticatedUser.ANONYMOUS_USER.</div>
</li>
</ul>
<a name="supportedOptions()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>supportedOptions</h4>
<pre>java.util.Set<<a href="../../../../org/apache/cassandra/auth/IAuthenticator.Option.html" title="enum in org.apache.cassandra.auth">IAuthenticator.Option</a>> supportedOptions()</pre>
<div class="block">Set of options supported by CREATE USER and ALTER USER queries.
Should never return null - always return an empty set instead.</div>
</li>
</ul>
<a name="alterableOptions()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>alterableOptions</h4>
<pre>java.util.Set<<a href="../../../../org/apache/cassandra/auth/IAuthenticator.Option.html" title="enum in org.apache.cassandra.auth">IAuthenticator.Option</a>> alterableOptions()</pre>
<div class="block">Subset of supportedOptions that users are allowed to alter when performing ALTER USER [themselves].
Should never return null - always return an empty set instead.</div>
</li>
</ul>
<a name="authenticate(java.util.Map)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>authenticate</h4>
<pre><a href="../../../../org/apache/cassandra/auth/AuthenticatedUser.html" title="class in org.apache.cassandra.auth">AuthenticatedUser</a> authenticate(java.util.Map<java.lang.String,java.lang.String> credentials)
throws <a href="../../../../org/apache/cassandra/exceptions/AuthenticationException.html" title="class in org.apache.cassandra.exceptions">AuthenticationException</a></pre>
<div class="block">Authenticates a user given a Map<String, String> of credentials.
Should never return null - always throw AuthenticationException instead.
Returning AuthenticatedUser.ANONYMOUS_USER is an option as well if authentication is not required.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/cassandra/exceptions/AuthenticationException.html" title="class in org.apache.cassandra.exceptions">AuthenticationException</a></code> - if credentials don't match any known user.</dd></dl>
</li>
</ul>
<a name="create(java.lang.String, java.util.Map)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create</h4>
<pre>void create(java.lang.String username,
java.util.Map<<a href="../../../../org/apache/cassandra/auth/IAuthenticator.Option.html" title="enum in org.apache.cassandra.auth">IAuthenticator.Option</a>,java.lang.Object> options)
throws <a href="../../../../org/apache/cassandra/exceptions/RequestValidationException.html" title="class in org.apache.cassandra.exceptions">RequestValidationException</a>,
<a href="../../../../org/apache/cassandra/exceptions/RequestExecutionException.html" title="class in org.apache.cassandra.exceptions">RequestExecutionException</a></pre>
<div class="block">Called during execution of CREATE USER query (also may be called on startup, see seedSuperuserOptions method).
If authenticator is static then the body of the method should be left blank, but don't throw an exception.
options are guaranteed to be a subset of supportedOptions().</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>username</code> - Username of the user to create.</dd><dd><code>options</code> - Options the user will be created with.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/cassandra/exceptions/RequestValidationException.html" title="class in org.apache.cassandra.exceptions">RequestValidationException</a></code></dd>
<dd><code><a href="../../../../org/apache/cassandra/exceptions/RequestExecutionException.html" title="class in org.apache.cassandra.exceptions">RequestExecutionException</a></code></dd></dl>
</li>
</ul>
<a name="alter(java.lang.String, java.util.Map)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>alter</h4>
<pre>void alter(java.lang.String username,
java.util.Map<<a href="../../../../org/apache/cassandra/auth/IAuthenticator.Option.html" title="enum in org.apache.cassandra.auth">IAuthenticator.Option</a>,java.lang.Object> options)
throws <a href="../../../../org/apache/cassandra/exceptions/RequestValidationException.html" title="class in org.apache.cassandra.exceptions">RequestValidationException</a>,
<a href="../../../../org/apache/cassandra/exceptions/RequestExecutionException.html" title="class in org.apache.cassandra.exceptions">RequestExecutionException</a></pre>
<div class="block">Called during execution of ALTER USER query.
options are always guaranteed to be a subset of supportedOptions(). Furthermore, if the user performing the query
is not a superuser and is altering himself, then options are guaranteed to be a subset of alterableOptions().
Keep the body of the method blank if your implementation doesn't support any options.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>username</code> - Username of the user that will be altered.</dd><dd><code>options</code> - Options to alter.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/cassandra/exceptions/RequestValidationException.html" title="class in org.apache.cassandra.exceptions">RequestValidationException</a></code></dd>
<dd><code><a href="../../../../org/apache/cassandra/exceptions/RequestExecutionException.html" title="class in org.apache.cassandra.exceptions">RequestExecutionException</a></code></dd></dl>
</li>
</ul>
<a name="drop(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>drop</h4>
<pre>void drop(java.lang.String username)
throws <a href="../../../../org/apache/cassandra/exceptions/RequestValidationException.html" title="class in org.apache.cassandra.exceptions">RequestValidationException</a>,
<a href="../../../../org/apache/cassandra/exceptions/RequestExecutionException.html" title="class in org.apache.cassandra.exceptions">RequestExecutionException</a></pre>
<div class="block">Called during execution of DROP USER query.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>username</code> - Username of the user that will be dropped.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/cassandra/exceptions/RequestValidationException.html" title="class in org.apache.cassandra.exceptions">RequestValidationException</a></code></dd>
<dd><code><a href="../../../../org/apache/cassandra/exceptions/RequestExecutionException.html" title="class in org.apache.cassandra.exceptions">RequestExecutionException</a></code></dd></dl>
</li>
</ul>
<a name="protectedResources()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>protectedResources</h4>
<pre>java.util.Set<? extends <a href="../../../../org/apache/cassandra/auth/IResource.html" title="interface in org.apache.cassandra.auth">IResource</a>> protectedResources()</pre>
<div class="block">Set of resources that should be made inaccessible to users and only accessible internally.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Keyspaces, column families that will be unmodifiable by users; other resources.</dd></dl>
</li>
</ul>
<a name="validateConfiguration()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>validateConfiguration</h4>
<pre>void validateConfiguration()
throws <a href="../../../../org/apache/cassandra/exceptions/ConfigurationException.html" title="class in org.apache.cassandra.exceptions">ConfigurationException</a></pre>
<div class="block">Validates configuration of IAuthenticator implementation (if configurable).</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/cassandra/exceptions/ConfigurationException.html" title="class in org.apache.cassandra.exceptions">ConfigurationException</a></code> - when there is a configuration error.</dd></dl>
</li>
</ul>
<a name="setup()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setup</h4>
<pre>void setup()</pre>
<div class="block">Setup is called once upon system startup to initialize the IAuthenticator.
For example, use this method to create any required keyspaces/column families.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/IAuthenticator.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/auth/DataResource.html" title="class in org.apache.cassandra.auth"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/auth/IAuthenticator.Option.html" title="enum in org.apache.cassandra.auth"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/auth/IAuthenticator.html" target="_top">Frames</a></li>
<li><a href="IAuthenticator.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested_class_summary">Nested</a> | </li>
<li><a href="#field_summary">Field</a> | </li>
<li>Constr | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li>Constr | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2014 The Apache Software Foundation</small></p>
</body>
</html>