JWSProcess

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

View Source
const (
	JWSProfileType = "profile"
	JWSRequestType = "request"
)

Variables

This section is empty.

Functions

func ProcessProfileJWS

func ProcessProfileJWS(requestJWs RequestJWS) mo.Result[ProfileJWS]

ProcessProfileJWS from RequestJWS to ProfileJWS

func ProcessProfileJWSstr added in v0.3.1

func ProcessProfileJWSstr(profileJWSstr string) mo.Result[ProfileJWS]

func ProcessRequestJWS

func ProcessRequestJWS(requestJWSReader io.ReadCloser) mo.Result[RequestJWS]

ProcessRequestJWS from reader to RequestJWS

Types

type ProfileJWS added in v0.0.2

type ProfileJWS struct {
	Header  jws.Headers       `json:"header"`
	Payload ProfileJWSPayload `json:"payload"`
}

ProfileJWS is struct of profile jws

type ProfileJWSPayload added in v0.0.2

type ProfileJWSPayload struct {
	Version     int      `json:"http://ariadne.id/version"`
	Type        string   `json:"http://ariadne.id/type"`
	Name        string   `json:"http://ariadne.id/name"`
	Claims      []string `json:"http://ariadne.id/claims"`
	Description string   `json:"http://ariadne.id/description,omitempty"`
	AvatarURL   string   `json:"http://ariadne.id/avatar_url,omitempty"`
	Email       string   `json:"http://ariadne.id/email,omitempty"`
	Color       string   `json:"http://ariadne.id/color,omitempty"`
	Exp         int64    `json:"http://ariadne.id/exp,omitempty"`
	// mini_sign_pub_key is my additional change,not in the specification
	MiniSignPubKey string `json:"mini_sign_pub_key,omitempty"`
}

ProfileJWSPayload is struct of profile jws payload TODO:if Specification change, this struct should be changed

type RequestJWS added in v0.0.2

type RequestJWS struct {
	Header  jws.Headers       `json:"header"`
	Payload RequestJWSPayload `json:"payload"`
}

RequestJWS is struct of request jws

type RequestJWSPayload added in v0.0.2

type RequestJWSPayload struct {
	Version    int    `json:"http://ariadne.id/version"`
	Type       string `json:"http://ariadne.id/type"`
	Action     string `json:"http://ariadne.id/action"`
	ProfileJws string `json:"http://ariadne.id/profile_jws,omitempty"`
	AspeUri    string `json:"http://ariadne.id/aspe_uri,omitempty"`
	Iat        int64  `json:"iat"`
}

RequestJWSPayload is struct of request jws payload

Jump to

Keyboard shortcuts

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