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:
readin classReader- Throws:
IOException
-
read
- Overrides:
readin classReader- Throws:
IOException
-
read
- Specified by:
readin interfaceReadable- Overrides:
readin classReader- Throws:
IOException
-
read
- Overrides:
readin classReader- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
skip
- Overrides:
skipin classReader- Throws:
IOException
-
ready
- Overrides:
readyin classReader- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classReader
-
mark
- Overrides:
markin classReader- Throws:
IOException
-
reset
- Overrides:
resetin classReader- Throws:
IOException
-