vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

performBasicAuth - multiple declarations

Function performBasicAuth

Returns a request handler that enforces request to be authenticated using HTTP Basic Auth.

@safe void delegate(scope HTTPServerRequest, HTTPServerResponse) performBasicAuth (
  string realm,
  @safe bool delegate(string, string) pwcheck
) @safe;

Function performBasicAuth

Scheduled for deprecation - use a @safe callback instead.

@safe void delegate(scope HTTPServerRequest, HTTPServerResponse) performBasicAuth (
  string realm,
  bool delegate(string, string) pwcheck
);

Function performBasicAuth

Enforces HTTP Basic Auth authentication on the given req/res pair.

string performBasicAuth (
  scope HTTPServerRequest req,
  scope HTTPServerResponse res,
  string realm,
  scope @safe bool delegate(string, string) pwcheck
) @safe;

Parameters

NameDescription
req Request object that is to be checked
res Response object that will be used for authentication errors
realm HTTP Basic Auth realm reported to the client
pwcheck A delegate queried for validating user/password pairs

Returns

Returns the name of the authenticated user.

Throws

Throws a HTTPStatusExeption in case of an authentication failure.

Function performBasicAuth

Scheduled for deprecation - use a @safe callback instead.

string performBasicAuth (
  scope HTTPServerRequest req,
  scope HTTPServerResponse res,
  string realm,
  scope bool delegate(string, string) pwcheck
);
Authors

Sönke Ludwig

Copyright

© 2012 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.