Skip to content

Commit ac8a78b

Browse files
committed
falco, security and webapplication documentation
1 parent a2db257 commit ac8a78b

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/Falco/Security.fs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ module Xsrf =
99
open Microsoft.Extensions.DependencyInjection
1010

1111
/// Outputs an antiforgery <input type="hidden" />.
12+
///
13+
/// This should be used within a form to include the antiforgery token as part
14+
/// of the form submission. The token is generated and stored in the user's
15+
/// cookies by calling `getToken` and then passed to this function to create
16+
/// the hidden input field.
17+
///
18+
/// - `token` - The antiforgery token set containing the form field name and request token value.
1219
let antiforgeryInput
1320
(token : AntiforgeryTokenSet) =
1421
Elem.input [

src/Falco/WebApplication.fs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module Extensions =
1010
open Microsoft.Extensions.Logging
1111

1212
type IEndpointRouteBuilder with
13+
/// Registers a sequence of `Falco.HttpEndpoint` with the endpoint route builder.
1314
member this.UseFalcoEndpoints(endpoints : HttpEndpoint seq) : IEndpointRouteBuilder =
1415
let falcoDataSource =
1516
let registeredDataSource = this.ServiceProvider.GetService<FalcoEndpointDataSource>()
@@ -54,12 +55,17 @@ module Extensions =
5455

5556
/// Activates Falco integration with IEndpointRouteBuilder.
5657
///
57-
/// This is the default way to enable the package.
58+
/// This is the default way to enable the library.
5859
member this.UseFalco(endpoints : HttpEndpoint seq) : IApplicationBuilder =
5960
this.UseEndpoints(fun endpointBuilder ->
6061
endpointBuilder.UseFalcoEndpoints(endpoints) |> ignore)
6162

6263
/// Registers a `Falco.HttpHandler` as terminal middleware (i.e., not found).
64+
/// This should be registered at the end of the middleware pipeline to catch any
65+
/// requests that were not handled by any other middleware. The provided
66+
/// handler will be executed for any requests that reach this point in
67+
/// the pipeline, allowing you to return a custom 404 response or perform
68+
/// other actions as needed.
6369
member this.UseFalcoNotFound(notFoundHandler : HttpHandler) : unit =
6470
this.Run(handler = HttpHandler.toRequestDelegate notFoundHandler)
6571

0 commit comments

Comments
 (0)