-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e181fd
commit 5b62727
Showing
8 changed files
with
107 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// rabbitmq-http-auth - demo implementation of the Auth interface, | ||
// which allows the user guest with ANY password to be authorized for | ||
// everything. | ||
// (c) copyright 2021 by Jan Delgado | ||
package main | ||
|
||
import ( | ||
rabbitmqauth "github.com/jandelgado/rabbitmq-http-auth/pkg" | ||
) | ||
|
||
type DemoAuth struct{} | ||
|
||
func (s DemoAuth) String() string { | ||
return "DemoAuth" | ||
} | ||
|
||
func (s DemoAuth) Resource(username, vhost, resource, name, permission string) rabbitmqauth.Decision { | ||
return rabbitmqauth.Allow | ||
} | ||
|
||
func (s DemoAuth) User(username, password string) (rabbitmqauth.Decision, string) { | ||
return username == "guest", "management administrator demo" | ||
} | ||
|
||
func (s DemoAuth) VHost(username, vhost, ip string) rabbitmqauth.Decision { | ||
return rabbitmqauth.Allow | ||
} | ||
|
||
func (s DemoAuth) Topic(username, vhost, resource, name, permission, routingKey string) rabbitmqauth.Decision { | ||
return rabbitmqauth.Allow | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.