Allow vault to work on Windows (elastic/elasticsearch#878)
Original commit: elastic/x-pack-elasticsearch@a404f4793a
This commit is contained in:
parent
15160e41a2
commit
af10f880fb
|
@ -34,9 +34,13 @@ final String VAULT_SECRET_ID = System.env.VAULT_SECRET_ID
|
|||
String authBody = null
|
||||
URL vaultUrl = null
|
||||
if (githubToken.exists()) {
|
||||
Set<PosixFilePermission> perms = Files.getPosixFilePermissions(githubToken.toPath())
|
||||
if (perms.equals(PosixFilePermissions.fromString("rw-------")) == false) {
|
||||
try {
|
||||
Set<PosixFilePermission> perms = Files.getPosixFilePermissions(githubToken.toPath())
|
||||
if (perms.equals(PosixFilePermissions.fromString("rw-------")) == false) {
|
||||
throw new GradleException('github.token must have 600 permissions')
|
||||
}
|
||||
} catch (UnsupportedOperationException e) {
|
||||
// Assume not on a POSIX file system
|
||||
}
|
||||
vaultUrl = new URL(VAULT_URL + '/v1/auth/github/login')
|
||||
authBody = "{\"token\": \"${githubToken.getText('UTF-8').trim()}\"}"
|
||||
|
|
Loading…
Reference in New Issue