Mainflux.mainflux/vendor/github.com/xdg/scram
Aleksandar Novaković 5799356b14 MF-549 - Change metadata format from JSON string to JSON object (#706)
* Update metadata type in things service

Update things service so that metadata has map type. Update repo
implementation by adding sqlx lib.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add sqlx lib to bootstrap service

Add sqlx lib to bootstrap service and update metadata field type.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update metadata in redis streams consumer

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update tests for bootstrap service

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix mongo reader logging and driver version

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix mongo reader and writer

Fix mongo reader and writer by updating driver version.

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update SDK with new metadata format

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update LoRa adapter with new metadata format

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update users service in order to use sqlx

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Replace anonymous struct with map

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Update docs for LoRa adapter

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix LoRa application metadata format

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Fix metadata format in LoRa docs

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>

* Add metadata2 var to SDK things test

Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
2019-04-16 14:58:56 +02:00
..
.gitignore MF-549 - Change metadata format from JSON string to JSON object (#706) 2019-04-16 14:58:56 +02:00
.travis.yml MF-549 - Change metadata format from JSON string to JSON object (#706) 2019-04-16 14:58:56 +02:00
LICENSE MF-549 - Change metadata format from JSON string to JSON object (#706) 2019-04-16 14:58:56 +02:00
README.md MF-549 - Change metadata format from JSON string to JSON object (#706) 2019-04-16 14:58:56 +02:00
client.go MF-549 - Change metadata format from JSON string to JSON object (#706) 2019-04-16 14:58:56 +02:00
client_conv.go MF-549 - Change metadata format from JSON string to JSON object (#706) 2019-04-16 14:58:56 +02:00
common.go MF-549 - Change metadata format from JSON string to JSON object (#706) 2019-04-16 14:58:56 +02:00
doc.go MF-549 - Change metadata format from JSON string to JSON object (#706) 2019-04-16 14:58:56 +02:00
parse.go MF-549 - Change metadata format from JSON string to JSON object (#706) 2019-04-16 14:58:56 +02:00
scram.go MF-549 - Change metadata format from JSON string to JSON object (#706) 2019-04-16 14:58:56 +02:00
server.go MF-549 - Change metadata format from JSON string to JSON object (#706) 2019-04-16 14:58:56 +02:00
server_conv.go MF-549 - Change metadata format from JSON string to JSON object (#706) 2019-04-16 14:58:56 +02:00

README.md

GoDoc Build Status

scram  Go implementation of RFC-5802

Description

Package scram provides client and server implementations of the Salted Challenge Response Authentication Mechanism (SCRAM) described in RFC-5802 and RFC-7677.

It includes both client and server side support.

Channel binding and extensions are not (yet) supported.

Examples

Client side

package main

import "github.com/xdg/scram"

func main() {
    // Get Client with username, password and (optional) authorization ID.
    clientSHA1, err := scram.SHA1.NewClient("mulder", "trustno1", "")
    if err != nil {
        panic(err)
    }

    // Prepare the authentication conversation. Use the empty string as the
    // initial server message argument to start the conversation.
    conv := clientSHA1.NewConversation()
    var serverMsg string

    // Get the first message, send it and read the response.
    firstMsg, err := conv.Step(serverMsg)
    if err != nil {
        panic(err)
    }
    serverMsg = sendClientMsg(firstMsg)

    // Get the second message, send it, and read the response.
    secondMsg, err := conv.Step(serverMsg)
    if err != nil {
        panic(err)
    }
    serverMsg = sendClientMsg(secondMsg)

    // Validate the server's final message.  We have no further message to
    // send so ignore that return value.
    _, err = conv.Step(serverMsg)
    if err != nil {
        panic(err)
    }

    return
}

func sendClientMsg(s string) string {
    // A real implementation would send this to a server and read a reply.
    return ""
}

Copyright 2018 by David A. Golden. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0