model

package
v0.0.0-...-04a9cd4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2017 Northern.tech AS

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copyright 2017 Northern.tech AS

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copyright 2017 Northern.tech AS

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Index

Constants

View Source
const (
	DevStatusAccepted      = "accepted"
	DevStatusRejected      = "rejected"
	DevStatusPending       = "pending"
	DevStatusPreauthorized = "preauthorized"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthID

type AuthID string

func (AuthID) String

func (aid AuthID) String() string

type AuthSet

type AuthSet struct {
	DeviceId string `json:"device_identity" valid:"required"`
	Key      string `json:"key" valid:"required"`
	//decoded, human-readable identity attribute set
	Attributes DeviceAuthAttributes `json:"-"`
}

func ParseAuthSet

func ParseAuthSet(source io.Reader) (*AuthSet, error)

func (*AuthSet) Validate

func (r *AuthSet) Validate() error

type DeviceAuth

type DeviceAuth struct {
	//system-generated authentication data set ID
	ID AuthID `json:"id" bson:",omitempty"`

	//device ID
	DeviceId DeviceID `json:"device_id" bson:",omitempty"`

	//blob of encrypted identity attributes
	DeviceIdentity string `json:"device_identity" bson:",omitempty"`

	//public key passed in authentication request
	Key string `json:"key" bson:",omitempty"`

	//admission status('accepted', 'rejected', 'pending')
	Status string `json:"status" bson:",omitempty"`

	//decoded, human-readable identity attribute set
	Attributes DeviceAuthAttributes `json:"attributes" bson:",omitempty"`

	//admission request reception time
	RequestTime *time.Time `json:"request_time" bson:"request_time,omitempty"`
}

Device authentication data set wrapper

type DeviceAuthAttributes

type DeviceAuthAttributes map[string]string

wrapper for device attributes data in authentication data set

type DeviceID

type DeviceID string

func (DeviceID) String

func (did DeviceID) String() string

type NewTenant

type NewTenant struct {
	TenantId string `json:"tenant_id"`
}

func ParseNewTenant

func ParseNewTenant(source io.Reader) (*NewTenant, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL