decoder

package
v0.0.0-...-61732bf Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package decoder implements base64 decoding of signed urls for insecure asset proxying. Copyright (c) 2012-2016 Eli Janssen Copyright (c) 2017 Berkeley Electronic Press Copyright (c) 2017 Reed O'Brien reed@reedobrien.com Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	Decode(string, string) (string, error)
}

Decoder is an interface that signs and encodes or verifies and decodes URLs for camo consumption.

type URLDecoder

type URLDecoder struct {
	// contains filtered or unexported fields
}

URLDecoder implements Decoder.

func MustNew

func MustNew(hmackey []byte) URLDecoder

MustNew returns a new UrlDecoder or panics.

func (URLDecoder) Decode

func (ed URLDecoder) Decode(dig, url string) (string, error)

Decode verifies the signature (digest) against the decoded url. It ensures the url is properly verified via HMAC, and then decodes the url, returning the url (if valid) or an error.

Jump to

Keyboard shortcuts

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