Skip to content

Commit

Permalink
IntelliJ code analyze changes for zts (#441)
Browse files Browse the repository at this point in the history
* IntelliJ code analyze changes

* IntelliJ code analyze changes for zts
  • Loading branch information
havetisyan authored Apr 10, 2018
1 parent 6c96aea commit 689b815
Show file tree
Hide file tree
Showing 80 changed files with 428 additions and 543 deletions.
4 changes: 2 additions & 2 deletions servers/zts/conf/athenz.properties
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ athenz.ssl_trust_store_password=athenz
#athenz.http_output_buffer_size=32768

# The maximum allowed size in bytes for a HTTP request header
#athenz.http_reqeust_header_size=8192
#athenz.http_request_header_size=8192

# The maximum allowed size in bytes for a HTTP response header
#athenz.http_response_header_size=8192
Expand Down Expand Up @@ -112,7 +112,7 @@ athenz.jetty_home=${ROOT}
# Boolean flag to enable debug log entries when deploying webapps
#athenz.debug=false

# Comma separated liste of uris that are accessed by health check
# Comma separated list of uris that are accessed by health check
# system. Used by the simple file based health check filter that
# returns 200/404 if the file exists or not
#athenz.health_check_uri_list=
Expand Down
2 changes: 1 addition & 1 deletion servers/zts/conf/zts.properties
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ athenz.zts.self_signer_private_key_fname=${ROOT}/var/zts_server/keys/zts_private
# property), this setting specifies in seconds the request timeout.
# We're setting the initial value to a small on so we know right away
# if our idle connection has been been closed by cert signer and we'll
# use our retry setting to retry with a max timout of 30 seconds.
# use our retry setting to retry with a max timeout of 30 seconds.
#athenz.zts.certsign_request_timeout=5

# HttpCertSignerFactory implementation - if this factory class is used
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Copyright 2017 Yahoo Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -109,7 +109,7 @@ public InstanceProvider getProvider(String provider) {
// it's valid according to configuration settings

InstanceProvider instanceProvider = null;
URI uri = null;
URI uri;
try {
uri = new URI(providerEndpoint);
} catch (URISyntaxException ex) {
Expand Down Expand Up @@ -140,7 +140,7 @@ InstanceProvider getClassProvider(String className, String providerName) {
if (provider != null) {
return provider;
}
Class<?> instanceClass = null;
Class<?> instanceClass;
try {
instanceClass = Class.forName(className);
} catch (ClassNotFoundException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Copyright 2016 Yahoo Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -30,8 +30,8 @@ public class RsrcCtxWrapper implements ResourceContext {
static final String HEADER_VALUE_NEGOTIATE = "negotiate";
private static final String ZTS_REQUEST_PRINCIPAL = "com.yahoo.athenz.auth.principal";

com.yahoo.athenz.common.server.rest.ResourceContext ctx = null;
boolean optionalAuth = false;
com.yahoo.athenz.common.server.rest.ResourceContext ctx;
boolean optionalAuth;

public RsrcCtxWrapper(HttpServletRequest request, HttpServletResponse response,
Http.AuthorityList authList, boolean optionalAuth, Authorizer authorizer) {
Expand Down
2 changes: 1 addition & 1 deletion servers/zts/src/main/java/com/yahoo/athenz/zts/ZTS.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Copyright 2017 Yahoo Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Copyright 2016 Yahoo Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -97,11 +97,7 @@ public boolean access(String op, String resource, Principal principal, String tr
}

AccessStatus accessStatus = evaluateAccess(domain, principal.getFullName(), op, resource, trustDomain);
if (accessStatus == AccessStatus.ALLOWED) {
return true;
}

return false;
return accessStatus == AccessStatus.ALLOWED;
}

boolean authorityAuthorizationAllowed(Principal principal) {
Expand All @@ -123,7 +119,7 @@ String retrieveResourceDomain(String resource, String op, String trustDomain) {
// if one is not specified then we'll fall back to using the domain name
// from the resource

String domainName = null;
String domainName;
if (ASSUME_ROLE.equalsIgnoreCase(op) && trustDomain != null) {
domainName = trustDomain;
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Copyright 2016 Yahoo Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Copyright 2016 Yahoo Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Loading

0 comments on commit 689b815

Please sign in to comment.