Package graphql.parser
Class SafeTokenReader
java.lang.Object
java.io.Reader
graphql.parser.SafeTokenReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
This reader will only emit a maximum number of characters from it. This is used to protect us from evil input.
If a graphql system does not have some max HTTP input limit, then this will help protect the system. This is a limit of last resort. Ideally the http input should be limited, but if its not, we have this.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSafeTokenReader
(Reader delegate, int maxCharacters, Consumer<Integer> whenMaxCharactersExceeded) -
Method Summary
Methods inherited from class java.io.Reader
nullReader, transferTo
-
Constructor Details
-
SafeTokenReader
-
-
Method Details
-
read
- Specified by:
read
in classReader
- Throws:
IOException
-
read
- Overrides:
read
in classReader
- Throws:
IOException
-
read
- Specified by:
read
in interfaceReadable
- Overrides:
read
in classReader
- Throws:
IOException
-
read
- Overrides:
read
in classReader
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
skip
- Overrides:
skip
in classReader
- Throws:
IOException
-
ready
- Overrides:
ready
in classReader
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classReader
-
mark
- Overrides:
mark
in classReader
- Throws:
IOException
-
reset
- Overrides:
reset
in classReader
- Throws:
IOException
-