Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename root package: auth -> authkit #4

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright © 2024 Acronis International GmbH.
Released under MIT license.
*/

package auth
package authkit

import (
"crypto/tls"
Expand Down
2 changes: 1 addition & 1 deletion auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright © 2024 Acronis International GmbH.
Released under MIT license.
*/

package auth
package authkit

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright © 2024 Acronis International GmbH.
Released under MIT license.
*/

package auth
package authkit

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright © 2024 Acronis International GmbH.
Released under MIT license.
*/

package auth
package authkit

import (
"bytes"
Expand Down
4 changes: 2 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Copyright © 2024 Acronis International GmbH.
Released under MIT license.
*/

// Package auth provides high-level helpers and basic objects for authN/authZ.
package auth
// Package authkit provides high-level helpers and basic objects for authN/authZ.
package authkit
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright © 2024 Acronis International GmbH.
Released under MIT license.
*/

package auth
package authkit

import (
"context"
Expand Down
8 changes: 7 additions & 1 deletion middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright © 2024 Acronis International GmbH.
Released under MIT license.
*/

package auth
package authkit

import (
"context"
Expand Down Expand Up @@ -94,6 +94,12 @@ func WithJWTAuthMiddlewareTokenIntrospector(tokenIntrospector TokenIntrospector)

// JWTAuthMiddleware is a middleware that does authentication
// by Access Token from the "Authorization" HTTP header of incoming request.
// errorDomain is used for error responses. It is usually the name of the service that uses the middleware,
// and its goal is distinguishing errors from different services.
// It helps to understand where the error occurred and what service caused it.
// For example, if the "Authorization" HTTP header is missing, the middleware will return 401 with the following response body:
//
// {"error": {"domain": "MyService", "code": "bearerTokenMissing", "message": "Authorization bearer token is missing."}}
func JWTAuthMiddleware(errorDomain string, jwtParser JWTParser, opts ...JWTAuthMiddlewareOption) func(next http.Handler) http.Handler {
var options jwtAuthMiddlewareOpts
for _, opt := range opts {
Expand Down
2 changes: 1 addition & 1 deletion middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright © 2024 Acronis International GmbH.
Released under MIT license.
*/

package auth
package authkit

import (
"context"
Expand Down
Loading