InterfaceAuthenticatedRequest
talawa-api • Docs
talawa-api / middleware/isAuth / InterfaceAuthenticatedRequest
Interface: InterfaceAuthenticatedRequest
Extends
Request
Properties
aborted
> aborted: boolean
The message.aborted
property will be true
if the request has
been aborted.
Since
v10.1.0
Deprecated
Since v17.0.0,v16.12.0 - Check message.destroyed
from <a href="stream.html#class-streamreadable" class="type">stream.Readable</a>.
Inherited from
Request.aborted
Defined in
node_modules/@types/node/http.d.ts:1180
accepted
> accepted: MediaType
[]
Return an array of Accepted media types ordered from highest quality to lowest.
Inherited from
Request.accepted
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:513
app
> app: Application
<Record
<string
, any
>>
Inherited from
Request.app
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:659
baseUrl
> baseUrl: string
Inherited from
Request.baseUrl
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:657
body
> body: any
Inherited from
Request.body
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:638
closed
> readonly
closed: boolean
Is true
after 'close'
has been emitted.
Since
v18.0.0
Inherited from
Request.closed
Defined in
node_modules/@types/node/stream.d.ts:126
complete
> complete: boolean
The message.complete
property will be true
if a complete HTTP message has
been received and successfully parsed.
This property is particularly useful as a means of determining if a client or server fully transmitted a message before a connection was terminated:
const req = http.request(\{
host: '127.0.0.1',
port: 8080,
method: 'POST',
\}, (res) =\> \{
res.resume();
res.on('end', () =\> \{
if (!res.complete)
console.error(
'The connection was terminated while the message was still being sent');
\});
\});
Since
v0.3.0
Inherited from
Request.complete
Defined in
node_modules/@types/node/http.d.ts:1215
connection
> connection: Socket
Alias for message.socket
.
Since
v0.1.90
Deprecated
Since v16.0.0 - Use socket
.
Inherited from
Request.connection
Defined in
node_modules/@types/node/http.d.ts:1221
cookies
> cookies: any
Inherited from
Request.cookies
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:641
destroyed
> destroyed: boolean
Is true
after readable.destroy()
has been called.
Since
v8.0.0
Inherited from
Request.destroyed
Defined in
node_modules/@types/node/stream.d.ts:121
errored
> readonly
errored: null
| Error
Returns error if the stream has been destroyed with an error.
Since
v18.0.0
Inherited from
Request.errored
Defined in
node_modules/@types/node/stream.d.ts:131
file?
> optional
file: File
Multer.File
object populated by single()
middleware.
Inherited from
Request.file
Defined in
node_modules/@types/multer/index.d.ts:41
files?
> optional
files: object
| File
[]
Array or dictionary of Multer.File
object populated by array()
,
fields()
, and any()
middleware.
Inherited from
Request.files
Defined in
node_modules/@types/multer/index.d.ts:46
fresh
> fresh: boolean
Check if the request is fresh, aka Last-Modified and/or the ETag still match.
Inherited from
Request.fresh
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:623
headers
> headers: IncomingHttpHeaders
The request/response headers object.
Key-value pairs of header names and values. Header names are lower-cased.
// Prints something like:
//
// \{ 'user-agent': 'curl/7.22.0',
// host: '127.0.0.1:8000',
// accept: '*' \}
console.log(request.headers);
Duplicates in raw headers are handled in the following ways, depending on the header name:
- Duplicates of
age
,authorization
,content-length
,content-type
,etag
,expires
,from
,host
,if-modified-since
,if-unmodified-since
,last-modified
,location
,max-forwards
,proxy-authorization
,referer
,retry-after
,server
, oruser-agent
are discarded. To allow duplicate values of the headers listed above to be joined, use the optionjoinDuplicateHeaders
in request and createServer. See RFC 9110 Section 5.3 for more information. set-cookie
is always an array. Duplicates are added to the array.- For duplicate
cookie
headers, the values are joined together with;
. - For all other headers, the values are joined together with
,
.
Since
v0.1.5
Inherited from
Request.headers
Defined in
node_modules/@types/node/http.d.ts:1261
headersDistinct
> headersDistinct: Dict
<string
[]>
Similar to message.headers
, but there is no join logic and the values are
always arrays of strings, even for headers received just once.
// Prints something like:
//
// \{ 'user-agent': ['curl/7.22.0'],
// host: ['127.0.0.1:8000'],
// accept: ['*'] \}
console.log(request.headersDistinct);
Since
v18.3.0, v16.17.0
Inherited from
Request.headersDistinct
Defined in
node_modules/@types/node/http.d.ts:1276
host
> host: string
Deprecated
Use hostname instead.
Inherited from
Request.host
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:616
hostname
> hostname: string
Parse the "Host" header field hostname.
Inherited from
Request.hostname
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:611
httpVersion
> httpVersion: string
In case of server request, the HTTP version sent by the client. In the case of
client response, the HTTP version of the connected-to server.
Probably either '1.1'
or '1.0'
.
Also message.httpVersionMajor
is the first integer and message.httpVersionMinor
is the second.
Since
v0.1.1
Inherited from
Request.httpVersion
Defined in
node_modules/@types/node/http.d.ts:1189
httpVersionMajor
> httpVersionMajor: number
Inherited from
Request.httpVersionMajor
Defined in
node_modules/@types/node/http.d.ts:1190
httpVersionMinor
> httpVersionMinor: number
Inherited from
Request.httpVersionMinor
Defined in
node_modules/@types/node/http.d.ts:1191
ip
> ip: undefined
| string
Return the remote address, or when
"trust proxy" is true
return
the upstream addr.
Value may be undefined if the req.socket
is destroyed
(for example, if the client disconnected).
Inherited from
Request.ip
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:578
ips
> ips: string
[]
When "trust proxy" is true
, parse
the "X-Forwarded-For" ip address list.
For example if the value were "client, proxy1, proxy2"
you would receive the array ["client", "proxy1", "proxy2"]
where "proxy2" is the furthest down-stream.
Inherited from
Request.ips
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:588
isAuth?
> optional
isAuth: boolean
Defined in
locale
> locale: string
Inherited from
Request.locale
Defined in
node_modules/@types/i18n/index.d.ts:456
method
> method: string
Only valid for request obtained from Server.
The request method as a string. Read only. Examples: 'GET'
, 'DELETE'
.
Since
v0.1.1
Inherited from
Request.method
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:643
next?
> optional
next: NextFunction
Inherited from
Request.next
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:666
originalUrl
> originalUrl: string
Inherited from
Request.originalUrl
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:653
params
> params: ParamsDictionary
Inherited from
Request.params
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:645
path
> path: string
Short-hand for url.parse(req.url).pathname
.
Inherited from
Request.path
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:606
protocol
> protocol: string
Return the protocol string "http" or "https" when requested with TLS. When the "trust proxy" setting is enabled the "X-Forwarded-Proto" header field will be trusted. If you're running behind a reverse proxy that supplies https for you this may be enabled.
Inherited from
Request.protocol
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:561
query
> query: ParsedQs
Inherited from
Request.query
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:647
rawHeaders
> rawHeaders: string
[]
The raw request/response headers list exactly as they were received.
The keys and values are in the same list. It is not a list of tuples. So, the even-numbered offsets are key values, and the odd-numbered offsets are the associated values.
Header names are not lowercased, and duplicates are not merged.
// Prints something like:
//
// [ 'user-agent',
// 'this is invalid because there can be only one',
// 'User-Agent',
// 'curl/7.22.0',
// 'Host',
// '127.0.0.1:8000',
// 'ACCEPT',
// '*' ]
console.log(request.rawHeaders);
Since
v0.11.6
Inherited from
Request.rawHeaders
Defined in
node_modules/@types/node/http.d.ts:1301
rawTrailers
> rawTrailers: string
[]
The raw request/response trailer keys and values exactly as they were
received. Only populated at the 'end'
event.
Since
v0.11.6
Inherited from
Request.rawTrailers
Defined in
node_modules/@types/node/http.d.ts:1319
readable
> readable: boolean
Is true
if it is safe to call read, which means
the stream has not been destroyed or emitted 'error'
or 'end'
.
Since
v11.4.0
Inherited from
Request.readable
Defined in
node_modules/@types/node/stream.d.ts:77
readableAborted
> readonly
readableAborted: boolean
Experimental
Returns whether the stream was destroyed or errored before emitting 'end'
.
Since
v16.8.0
Inherited from
Request.readableAborted
Defined in
node_modules/@types/node/stream.d.ts:71
readableDidRead
> readonly
readableDidRead: boolean
Experimental
Returns whether 'data'
has been emitted.
Since
v16.7.0, v14.18.0
Inherited from
Request.readableDidRead
Defined in
node_modules/@types/node/stream.d.ts:83
readableEncoding
> readonly
readableEncoding: null
| BufferEncoding
Getter for the property encoding
of a given Readable
stream. The encoding
property can be set using the setEncoding method.
Since
v12.7.0
Inherited from
Request.readableEncoding
Defined in
node_modules/@types/node/stream.d.ts:88
readableEnded
> readonly
readableEnded: boolean
Becomes true
when 'end'
event is emitted.
Since
v12.9.0
Inherited from
Request.readableEnded
Defined in
node_modules/@types/node/stream.d.ts:93
readableFlowing
> readonly
readableFlowing: null
| boolean
This property reflects the current state of a Readable
stream as described
in the Three states section.
Since
v9.4.0
Inherited from
Request.readableFlowing
Defined in
node_modules/@types/node/stream.d.ts:99
readableHighWaterMark
> readonly
readableHighWaterMark: number
Returns the value of highWaterMark
passed when creating this Readable
.
Since
v9.3.0
Inherited from
Request.readableHighWaterMark
Defined in
node_modules/@types/node/stream.d.ts:104
readableLength
> readonly
readableLength: number
This property contains the number of bytes (or objects) in the queue
ready to be read. The value provides introspection data regarding
the status of the highWaterMark
.
Since
v9.4.0
Inherited from
Request.readableLength
Defined in
node_modules/@types/node/stream.d.ts:111
readableObjectMode
> readonly
readableObjectMode: boolean
Getter for the property objectMode
of a given Readable
stream.
Since
v12.3.0
Inherited from
Request.readableObjectMode
Defined in
node_modules/@types/node/stream.d.ts:116
res?
> optional
res: Response
<any
, Record
<string
, any
>, number
>
After middleware.init executed, Request will contain res and next properties See: express/lib/middleware/init.js
Inherited from
Request.res
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:665
route
> route: any
Inherited from
Request.route
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:649
secure
> secure: boolean
Short-hand for:
req.protocol == 'https'
Inherited from
Request.secure
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:568
signedCookies
> signedCookies: any
Inherited from
Request.signedCookies
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:651
socket
> socket: Socket
The net.Socket
object associated with the connection.
With HTTPS support, use request.socket.getPeerCertificate()
to obtain the
client's authentication details.
This property is guaranteed to be an instance of the net.Socket
class,
a subclass of stream.Duplex
, unless the user specified a socket
type other than net.Socket
or internally nulled.
Since
v0.3.0
Inherited from
Request.socket
Defined in
node_modules/@types/node/http.d.ts:1233
stale
> stale: boolean
Check if the request is stale, aka "Last-Modified" and / or the "ETag" for the resource has changed.
Inherited from
Request.stale
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:630
statusCode?
> optional
statusCode: number
Only valid for response obtained from ClientRequest.
The 3-digit HTTP response status code. E.G. 404
.
Since
v0.1.1
Inherited from
Request.statusCode
Defined in
node_modules/@types/node/http.d.ts:1381
statusMessage?
> optional
statusMessage: string
Only valid for response obtained from ClientRequest.
The HTTP response status message (reason phrase). E.G. OK
or Internal Server Error
.
Since
v0.11.10
Inherited from
Request.statusMessage
Defined in
node_modules/@types/node/http.d.ts:1388
subdomains
> subdomains: string
[]
Return subdomains as an array.
Subdomains are the dot-separated parts of the host before the main domain of the app. By default, the domain of the app is assumed to be the last two parts of the host. This can be changed by setting "subdomain offset".
For example, if the domain is "tobi.ferrets.example.com":
If "subdomain offset" is not set, req.subdomains is ["ferrets", "tobi"]
.
If "subdomain offset" is 3, req.subdomains is ["tobi"]
.
Inherited from
Request.subdomains
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:601
tokenExpired?
> optional
tokenExpired: boolean
Defined in
trailers
> trailers: Dict
<string
>
The request/response trailers object. Only populated at the 'end'
event.
Since
v0.3.0
Inherited from
Request.trailers
Defined in
node_modules/@types/node/http.d.ts:1306
trailersDistinct
> trailersDistinct: Dict
<string
[]>
Similar to message.trailers
, but there is no join logic and the values are
always arrays of strings, even for headers received just once.
Only populated at the 'end'
event.
Since
v18.3.0, v16.17.0
Inherited from
Request.trailersDistinct
Defined in
node_modules/@types/node/http.d.ts:1313
url
> url: string
Only valid for request obtained from Server.
Request URL string. This contains only the URL that is present in the actual HTTP request. Take the following request:
GET /status?name=ryan HTTP/1.1
Accept: text/plain
To parse the URL into its parts:
new URL(`http://$\{process.env.HOST ?? 'localhost'\}$\{request.url\}`);
When request.url
is '/status?name=ryan'
and process.env.HOST
is undefined:
$ node
\> new URL(`http://$\{process.env.HOST ?? 'localhost'\}$\{request.url\}`);
URL \{
href: 'http://localhost/status?name=ryan',
origin: 'http://localhost',
protocol: 'http:',
username: '',
password: '',
host: 'localhost',
hostname: 'localhost',
port: '',
pathname: '/status',
search: '?name=ryan',
searchParams: URLSearchParams \{ 'name' =\> 'ryan' \},
hash: ''
\}
Ensure that you set process.env.HOST
to the server's host name, or consider replacing this part entirely. If using req.headers.host
, ensure proper
validation is used, as clients may specify a custom Host
header.
Since
v0.1.90
Inherited from
Request.url
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:655
userId?
> optional
userId: string
Defined in
xhr
> xhr: boolean
Check if the request was an XMLHttpRequest.
Inherited from
Request.xhr
Defined in
node_modules/@types/express-serve-static-core/index.d.ts:635
Methods
[asyncDispose]()
> [asyncDispose](): Promise
<void
>
Calls readable.destroy()
with an AbortError
and returns a promise that fulfills when the stream is finished.
Returns
Promise
<void
>
Since
v20.4.0
Inherited from
Request.[asyncDispose]