tokenendpoints

package
v0.0.0-...-4dafefa Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2024 Pantacor Ltd.

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 2024 Pantacor Ltd.

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 2024 Pantacor Ltd.

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 2024 Pantacor Ltd.

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 2024 Pantacor Ltd.

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 Endpoints

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

func New

func New(service tokenservice.ServiceI) *Endpoints

func (*Endpoints) CreateToken

func (app *Endpoints) CreateToken(w rest.ResponseWriter, r *rest.Request)

CreateToken Create a new token for a user @Summary Create a new token for a user @Description Create a new token for a user @Accept json @Produce json @Tags tokens @Security ApiKeyAuth @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Param req body tokenservice.AuthTokenReqPayload true "Create Token Request" @Success 200 {object} tokenmodels.AuthToken @Failure 400 {object} utils.RError @Failure 403 {object} utils.RError @Failure 500 {object} utils.RError @Router /tokens/ [post]

func (*Endpoints) DeleteToken

func (app *Endpoints) DeleteToken(w rest.ResponseWriter, r *rest.Request)

DeleteToken Delete a token for a user @Summary Delete a token for a user @Description Delete a token for a user @Accept json @Produce json @Tags tokens @Security ApiKeyAuth @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Param id path string true "Token ID" @Success 200 {object} map[string]interface{} @Failure 400 {object} utils.RError @Failure 403 {object} utils.RError @Failure 500 {object} utils.RError @Router /tokens/{id} [delete]

func (*Endpoints) GetToken

func (app *Endpoints) GetToken(w rest.ResponseWriter, r *rest.Request)

GetToken get a token for a user @Summary get a token for a user @Description get a token for a user @Accept json @Produce json @Tags tokens @Security ApiKeyAuth @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Param id path string true "Token ID" @Success 200 {object} tokenmodels.AuthToken @Failure 400 {object} utils.RError @Failure 403 {object} utils.RError @Failure 500 {object} utils.RError @Router /tokens/{id} [get]

func (*Endpoints) ListTokens

func (app *Endpoints) ListTokens(w rest.ResponseWriter, r *rest.Request)

ListTokens List tokens for a owner @Summary List tokens for a owner @Description List tokens for a owner @Tags tokens @Accept json @Produce json @Param owner query string true "Owner" @Param limit query int false "Limit" @Param offset query int false "Offset" @Param sort query string false "Sort" @Param createdAt query string false "CreatedAt" @Success 200 {array} tokenservice.ListOfToken @Failure 400 {object} utils.RError "Bad Request" @Failure 403 {object} utils.RError "Forbidden" @Failure 404 {object} utils.RError "Not Found" @Failure 500 {object} utils.RError "Internal Server Error" @Router /tokens [get]

Jump to

Keyboard shortcuts

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