Skip to content

Commit

Permalink
Cleanup file based password authenticator
Browse files Browse the repository at this point in the history
Fix property name in password file docs
Add missing config null checks
  • Loading branch information
dain committed Sep 28, 2020
1 parent 5961d29 commit 2fa1305
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions presto-docs/src/main/sphinx/security/password-file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ The following configuration properties are available:
==================================== ==============================================
Property Description
==================================== ==============================================
``file.password`` Path of the password file.
``file.password-file`` Path of the password file.

``file.refresh-period`` How often to reload the password file.
Defaults to ``1m``.
Defaults to ``5s``.

``file.auth-token-cache.max-size`` Max number of cached authenticated passwords.
Defaults to ``1000``.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import io.airlift.units.Duration;
import io.airlift.units.MinDuration;

import javax.validation.constraints.NotNull;

import java.io.File;

import static java.util.concurrent.TimeUnit.SECONDS;
Expand All @@ -29,6 +31,7 @@ public class FileConfig
private Duration refreshPeriod = new Duration(5, SECONDS);
private int authTokenCacheMaxSize = 1000;

@NotNull
@FileExists
public File getPasswordFile()
{
Expand All @@ -43,6 +46,7 @@ public FileConfig setPasswordFile(File passwordFile)
return this;
}

@NotNull
@MinDuration("1ms")
public Duration getRefreshPeriod()
{
Expand Down

0 comments on commit 2fa1305

Please sign in to comment.