mirror of
https://github.com/minio/minio.git
synced 2025-11-29 05:19:03 -05:00
api: Implement bucket notification. (#2271)
* Implement basic S3 notifications through queues Supports multiple queues and three basic queue types: 1. NilQueue -- messages don't get sent anywhere 2. LogQueue -- messages get logged 3. AmqpQueue -- messages are sent to an AMQP queue * api: Implement bucket notification. Supports two different queue types - AMQP - ElasticSearch. * Add support for redis
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
f85d94288d
commit
f248089523
44
vendor/github.com/streadway/amqp/auth.go
generated
vendored
Normal file
44
vendor/github.com/streadway/amqp/auth.go
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
// Copyright (c) 2012, Sean Treadway, SoundCloud Ltd.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// Source code and contact info at http://github.com/streadway/amqp
|
||||
|
||||
package amqp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Authentication interface provides a means for different SASL authentication
|
||||
// mechanisms to be used during connection tuning.
|
||||
type Authentication interface {
|
||||
Mechanism() string
|
||||
Response() string
|
||||
}
|
||||
|
||||
// PlainAuth is a similar to Basic Auth in HTTP.
|
||||
type PlainAuth struct {
|
||||
Username string
|
||||
Password string
|
||||
}
|
||||
|
||||
func (me *PlainAuth) Mechanism() string {
|
||||
return "PLAIN"
|
||||
}
|
||||
|
||||
func (me *PlainAuth) Response() string {
|
||||
return fmt.Sprintf("\000%s\000%s", me.Username, me.Password)
|
||||
}
|
||||
|
||||
// Finds the first mechanism preferred by the client that the server supports.
|
||||
func pickSASLMechanism(client []Authentication, serverMechanisms []string) (auth Authentication, ok bool) {
|
||||
for _, auth = range client {
|
||||
for _, mech := range serverMechanisms {
|
||||
if auth.Mechanism() == mech {
|
||||
return auth, true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user