private void checkSignature(SignableVertexSpec vertex, ByteString vertexBinary, SubmitWorkRequestProto request, String tokenUserName) throws SecurityException, IOException { if (!request.hasWorkSpecSignature()) { logSecurityErrorRarely(tokenUserName); throw new SecurityException("Unsigned fragment not allowed"); } if (vertexBinary == null) { ByteString.Output os = ByteString.newOutput(); vertex.writeTo(os); vertexBinary = os.toByteString(); } try { signer.checkSignature(vertexBinary.toByteArray(), request.getWorkSpecSignature().toByteArray(), (int)vertex.getSignatureKeyId()); } catch (SecurityException ex) { logSecurityErrorRarely(tokenUserName); throw ex; } if (!vertex.hasUser() || !vertex.getUser().equals(tokenUserName)) { logSecurityErrorRarely(tokenUserName); throw new SecurityException("LLAP token is for " + tokenUserName + " but the fragment is for " + (vertex.hasUser() ? vertex.getUser() : null)); } }
hash = (53 * hash) + getWorkSpec().hashCode(); if (hasWorkSpecSignature()) { hash = (37 * hash) + WORK_SPEC_SIGNATURE_FIELD_NUMBER; hash = (53 * hash) + getWorkSpecSignature().hashCode();
.equals(other.getWorkSpec()); result = result && (hasWorkSpecSignature() == other.hasWorkSpecSignature()); if (hasWorkSpecSignature()) { result = result && getWorkSpecSignature() .equals(other.getWorkSpecSignature());
private void checkSignature(SignableVertexSpec vertex, ByteString vertexBinary, SubmitWorkRequestProto request, String tokenUserName) throws SecurityException, IOException { if (!request.hasWorkSpecSignature()) { logSecurityErrorRarely(tokenUserName); throw new SecurityException("Unsigned fragment not allowed"); } if (vertexBinary == null) { ByteString.Output os = ByteString.newOutput(); vertex.writeTo(os); vertexBinary = os.toByteString(); } try { signer.checkSignature(vertexBinary.toByteArray(), request.getWorkSpecSignature().toByteArray(), (int)vertex.getSignatureKeyId()); } catch (SecurityException ex) { logSecurityErrorRarely(tokenUserName); throw ex; } if (!vertex.hasUser() || !vertex.getUser().equals(tokenUserName)) { logSecurityErrorRarely(tokenUserName); throw new SecurityException("LLAP token is for " + tokenUserName + " but the fragment is for " + (vertex.hasUser() ? vertex.getUser() : null)); } }
mergeWorkSpec(other.getWorkSpec()); if (other.hasWorkSpecSignature()) { setWorkSpecSignature(other.getWorkSpecSignature());