jwt

package
v0.0.0-...-7b47e17 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * 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 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * 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 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * 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 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SigningFunc

type SigningFunc = func([]byte) ([]byte, error)

type Token

type Token struct {
	Header TokenHeader

	Payload TokenPayload
	// contains filtered or unexported fields
}

func NewToken

func NewToken(options *TokenOptions, signingFunc SigningFunc) (*Token, error)

func ParseToken

func ParseToken(t string) (*Token, error)

func (*Token) String

func (t *Token) String() (string, error)

func (*Token) Verify

func (t *Token) Verify(verifyFunc VerifyFunc) error

type TokenHeader

type TokenHeader struct {
	Algorithm string `json:"alg,omitempty"`
	Type      string `json:"typ,omitempty"`
	KeyId     string `json:"keyid,omitempty"`
}

type TokenOptions

type TokenOptions struct {
	Algorithm string
	Type      string
	KeyId     string

	Issuer          string
	Audience        string
	Subject         string
	AuthorizedParty string
	IssuedAt        time.Time
	ExpiresAt       time.Time
	NotBefore       time.Time

	Claims map[string]interface{}
}

type TokenPayload

type TokenPayload struct {
	Issuer          string
	Audience        string
	AuthorizedParty string
	Subject         string
	IssuedAt        time.Time
	ExpiresAt       time.Time
	NotBefore       time.Time
	// contains filtered or unexported fields
}

func (TokenPayload) MarshalJSON

func (p TokenPayload) MarshalJSON() ([]byte, error)

func (*TokenPayload) UnmarshalJSON

func (p *TokenPayload) UnmarshalJSON(data []byte) error

type VerifyFunc

type VerifyFunc = func([]byte, []byte) error

Jump to

Keyboard shortcuts

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