Skip to content

Commit d2df381

Browse files
committed
Merge pull request #1 from e-solinas/master
Update README
2 parents f28ad3e + 0a59312 commit d2df381

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

README.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
11
# go-iis-auth
22

3-
Collection of middlewares, utils, prayers to hamdle Windows Authentication in Go
3+
This repository contains a collection of middleware functions that let you add informations about a Windows User (identified by Windows Authentication) to a Go context, or obtain the port used by IIS if that is how you serve your application.
4+
5+
There are two main packages:
6+
7+
* `goav1`: contains middleware functions that are specific for [Goa v1](https://goa.design/v1)
8+
* `http`: contains standard HTTP middleware functions, that can be used with [Goa v3](https://goa.design/).
9+
10+
**IMPORTANT NOTE**: these middleware functions will work as expected only if compiled for Windows. If you try to use them on a Unix environment, you will obtain mock data.
11+
12+
## How to use this package with Goa v1
13+
14+
1. Import the package by using:
15+
16+
```go
17+
import (
18+
admiddleware "github.com/top-solution/go-iis-auth/goav1"
19+
)
20+
```
21+
22+
2. Mount the middleware as show in the following example:
23+
24+
```go
25+
service.Use(admiddleware.WithUser())
26+
```
27+
28+
## How to use this package with Goa v3 or a standard HTTP handler
29+
30+
1. Import the package by using:
31+
32+
```go
33+
import (
34+
admiddleware "github.com/top-solution/go-iis-auth/http"
35+
)
36+
```
37+
38+
2. Mount the middleware as shown in the following example:
39+
40+
```go
41+
var handler http.Handler = mux
42+
{
43+
handler = admiddleware.WithUser()(handler)
44+
}
45+
```

0 commit comments

Comments
 (0)