/** * Encode authorization header, using Thrift JSON format for simplicity */ private String encodeAuthorizationHeader(HttpAuthorizationHeader auth) { TSerializer serializer = new TSerializer(new TJSONProtocol.Factory()); try { byte[] bytes = serializer.serialize(auth); return new String(bytes); } catch (TException e) { throw new RuntimeException("Failed to serialize authentication header: " + auth, e); } }
return new TJSONProtocol.Factory();
/** * Encode authorization header, using Thrift JSON format for simplicity */ private String encodeAuthorizationHeader(HttpAuthorizationHeader auth) { TSerializer serializer = new TSerializer(new TJSONProtocol.Factory()); try { byte[] bytes = serializer.serialize(auth); return new String(bytes); } catch (TException e) { throw new RuntimeException("Failed to serialize authentication header: " + auth, e); } }