Class GSIBucketUtils
- java.lang.Object
-
- org.dcache.xrootd.plugins.authn.gsi.GSIBucketUtils
-
public class GSIBucketUtils extends java.lang.ObjectUtilities for deserializing, writing, and printing out GSI byte buckets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGSIBucketUtils.BucketDataThe Xrootd GSI protocol passes handshake information in structs that are called "buckets".static classGSIBucketUtils.BucketSerializerstatic classGSIBucketUtils.BucketSerializerBuilder
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GSIBucketdeserialize(XrootdSecurityProtocol.BucketType type, io.netty.buffer.ByteBuf buffer)Deserialize an XrootdBucket.static java.util.Map<XrootdSecurityProtocol.BucketType,GSIBucket>deserializeBuckets(io.netty.buffer.ByteBuf buffer)Deserialize the buckets sent by the client and put them into a EnumMap sorted by their header-information.static GSIBucketUtils.BucketDatadeserializeData(AuthenticationRequest request)static GSIBucketUtils.BucketDatadeserializeData(InboundAuthenticationResponse response)static NestedBucketBufferdeserializeNested(XrootdSecurityProtocol.BucketType type, io.netty.buffer.ByteBuf buffer)Deserialize the NestedBucketBuffer.static voiddumpBuckets(java.lang.StringBuilder builder, java.util.Collection<GSIBucket> buckets, java.lang.String step)static voiddumpBytes(java.lang.StringBuilder builder, byte[] data)static intgetLengthForRequest(GSIBucketContainer container)
-
-
-
Method Detail
-
deserialize
public static GSIBucket deserialize(XrootdSecurityProtocol.BucketType type, io.netty.buffer.ByteBuf buffer) throws java.io.IOException
Deserialize an XrootdBucket. Depending on the BucketType, return an XrootdBucket of a specific subtype. The only type where the returned type is not a-priori known is kXRS_main, which can be encrypted. If it is encrypted, a binary (raw) bucket is returned, if it is not encyrpted, a list of contained buckets (nestedBuffer) is returned.- Parameters:
type- The type of the bucket that should be deserializedbuffer- The buffer containing the buckets- Returns:
- The deserialized bucket
- Throws:
java.io.IOException
-
deserializeBuckets
public static java.util.Map<XrootdSecurityProtocol.BucketType,GSIBucket> deserializeBuckets(io.netty.buffer.ByteBuf buffer) throws java.io.IOException
Deserialize the buckets sent by the client and put them into a EnumMap sorted by their header-information. As there are list-type buffers, this method can be called recursively. In current xrootd, this is limited to a maximum of 1 recursion (main buffer containing list of further buffers).- Parameters:
buffer- The buffer containing the received buckets- Returns:
- Map from bucket-type to deserialized buckets
- Throws:
java.io.IOException- Failure of deserialization
-
deserializeData
public static GSIBucketUtils.BucketData deserializeData(AuthenticationRequest request)
-
deserializeData
public static GSIBucketUtils.BucketData deserializeData(InboundAuthenticationResponse response) throws XrootdException
- Throws:
XrootdException
-
deserializeNested
public static NestedBucketBuffer deserializeNested(XrootdSecurityProtocol.BucketType type, io.netty.buffer.ByteBuf buffer) throws java.io.IOException
Deserialize the NestedBucketBuffer. Retrieve all the buckets and recursively deserialize them. Also, retrieve the protocol information and the step.- Parameters:
type- The type of the bucket (usually kXRS_main)buffer- The buffer containing the nested bucket buffer- Returns:
- Deserialized buffer
- Throws:
java.io.IOException- Deserialization fails
-
dumpBuckets
public static void dumpBuckets(java.lang.StringBuilder builder, java.util.Collection<GSIBucket> buckets, java.lang.String step)
-
dumpBytes
public static void dumpBytes(java.lang.StringBuilder builder, byte[] data)
-
getLengthForRequest
public static int getLengthForRequest(GSIBucketContainer container)
-
-