Interface IamPolicyReader
-
- All Known Implementing Classes:
DefaultIamPolicyReader
@ThreadSafe public interface IamPolicyReader
TheIamPolicyReaderconverts a JSON policy into anIamPolicy.Usage Examples
Log the number of statements in a policy downloaded from IAM.- See Also:
IamPolicy.fromJson(String)
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static IamPolicyReadercreate()Create a newIamPolicyReader.IamPolicyread(byte[] policy)Read a policy from abytearray.IamPolicyread(InputStream policy)Read a policy from anInputStream.IamPolicyread(String policy)Read a policy from aString.
-
-
-
Method Detail
-
create
static IamPolicyReader create()
Create a newIamPolicyReader.This method is inexpensive, allowing the creation of readers wherever they are needed.
-
read
IamPolicy read(String policy)
Read a policy from aString.This only performs minimal validation on the provided policy.
- Throws:
RuntimeException- If the provided policy is not valid JSON or is missing a minimal set of required fields.
-
read
IamPolicy read(InputStream policy)
Read a policy from anInputStream.The stream must provide a UTF-8 encoded string representing the policy. This only performs minimal validation on the provided policy.
- Throws:
RuntimeException- If the provided policy is not valid JSON or is missing a minimal set of required fields.
-
read
IamPolicy read(byte[] policy)
Read a policy from abytearray.The stream must provide a UTF-8 encoded string representing the policy. This only performs minimal validation on the provided policy.
- Throws:
RuntimeException- If the provided policy is not valid JSON or is missing a minimal set of required fields.
-
-