mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-24 13:48:49 +08:00

* NOISSUE - Fix Bugs (#20) * fix bugs Signed-off-by: Arvindh <arvindh91@gmail.com> * fix bugs Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add Connect Disconnect endpoints (#23) * fix bugs Signed-off-by: Arvindh <arvindh91@gmail.com> * fix bugs Signed-off-by: Arvindh <arvindh91@gmail.com> * fix list of things in a channel and Add connect disconnect endpoint Signed-off-by: Arvindh <arvindh91@gmail.com> * fix list of things in a channel and Add connect disconnect endpoint Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add: Things share with users (#25) * fix list of things in a channel and Add connect disconnect endpoint Signed-off-by: Arvindh <arvindh91@gmail.com> * add: things share with other users Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add: Listing of things, channels, groups, users (#26) * add: listing of channels, users, groups, things Signed-off-by: Arvindh <arvindh91@gmail.com> * add: listing of channels, users, groups, things Signed-off-by: Arvindh <arvindh91@gmail.com> * add: listing of channels, users, groups, things Signed-off-by: Arvindh <arvindh91@gmail.com> * add: listing of channels, users, groups, things Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add: List of user groups & removed repeating code in groups (#29) * removed repeating code in list groups Signed-off-by: Arvindh <arvindh91@gmail.com> * add: list of user group Signed-off-by: Arvindh <arvindh91@gmail.com> * fix: otel handler operator name for endpoints Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * add: listing of shared things and users Signed-off-by: Arvindh <arvindh91@gmail.com> * fix: listing of shared things and users Signed-off-by: Arvindh <arvindh91@gmail.com> * add: new SDK Signed-off-by: Arvindh <arvindh91@gmail.com> * add: new SDK Signed-off-by: Arvindh <arvindh91@gmail.com> * fix: comment Signed-off-by: Arvindh <arvindh91@gmail.com> * fix: sdk function names Signed-off-by: Arvindh <arvindh91@gmail.com> * update: api spec Signed-off-by: Arvindh <arvindh91@gmail.com> * fix: channels connect request Signed-off-by: Arvindh <arvindh91@gmail.com> * fix: listing of clients and groups Signed-off-by: Arvindh <arvindh91@gmail.com> * fix: CLI Signed-off-by: Arvindh <arvindh91@gmail.com> * fix: array len comparision Signed-off-by: Arvindh <arvindh91@gmail.com> * fix: nginx Signed-off-by: Arvindh <arvindh91@gmail.com> --------- Signed-off-by: Arvindh <arvindh91@gmail.com> Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
75 lines
3.2 KiB
Go
75 lines
3.2 KiB
Go
// Copyright (c) Mainflux
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package users
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/mainflux/mainflux"
|
|
"github.com/mainflux/mainflux/pkg/clients"
|
|
)
|
|
|
|
// Service specifies an API that must be fullfiled by the domain service
|
|
// implementation, and all of its decorators (e.g. logging & metrics).
|
|
type Service interface {
|
|
// RegisterClient creates new client. In case of the failed registration, a
|
|
// non-nil error value is returned.
|
|
RegisterClient(ctx context.Context, token string, client clients.Client) (clients.Client, error)
|
|
|
|
// ViewClient retrieves client info for a given client ID and an authorized token.
|
|
ViewClient(ctx context.Context, token, id string) (clients.Client, error)
|
|
|
|
// ViewProfile retrieves client info for a given token.
|
|
ViewProfile(ctx context.Context, token string) (clients.Client, error)
|
|
|
|
// ListClients retrieves clients list for a valid auth token.
|
|
ListClients(ctx context.Context, token string, pm clients.Page) (clients.ClientsPage, error)
|
|
|
|
// ListMembers retrieves everything that is assigned to a group/thing identified by objectID.
|
|
ListMembers(ctx context.Context, token, objectKind, objectID string, pm clients.Page) (clients.MembersPage, error)
|
|
|
|
// UpdateClient updates the client's name and metadata.
|
|
UpdateClient(ctx context.Context, token string, client clients.Client) (clients.Client, error)
|
|
|
|
// UpdateClientTags updates the client's tags.
|
|
UpdateClientTags(ctx context.Context, token string, client clients.Client) (clients.Client, error)
|
|
|
|
// UpdateClientIdentity updates the client's identity.
|
|
UpdateClientIdentity(ctx context.Context, token, id, identity string) (clients.Client, error)
|
|
|
|
// GenerateResetToken email where mail will be sent.
|
|
// host is used for generating reset link.
|
|
GenerateResetToken(ctx context.Context, email, host string) error
|
|
|
|
// UpdateClientSecret updates the client's secret.
|
|
UpdateClientSecret(ctx context.Context, token, oldSecret, newSecret string) (clients.Client, error)
|
|
|
|
// ResetSecret change users secret in reset flow.
|
|
// token can be authentication token or secret reset token.
|
|
ResetSecret(ctx context.Context, resetToken, secret string) error
|
|
|
|
// SendPasswordReset sends reset password link to email.
|
|
SendPasswordReset(ctx context.Context, host, email, user, token string) error
|
|
|
|
// UpdateClientOwner updates the client's owner.
|
|
UpdateClientOwner(ctx context.Context, token string, client clients.Client) (clients.Client, error)
|
|
|
|
// EnableClient logically enableds the client identified with the provided ID.
|
|
EnableClient(ctx context.Context, token, id string) (clients.Client, error)
|
|
|
|
// DisableClient logically disables the client identified with the provided ID.
|
|
DisableClient(ctx context.Context, token, id string) (clients.Client, error)
|
|
|
|
// Identify returns the client id from the given token.
|
|
Identify(ctx context.Context, tkn string) (string, error)
|
|
|
|
// IssueToken issues a new access and refresh token.
|
|
IssueToken(ctx context.Context, identity, secret string) (*mainflux.Token, error)
|
|
|
|
// RefreshToken refreshes expired access tokens.
|
|
// After an access token expires, the refresh token is used to get
|
|
// a new pair of access and refresh tokens.
|
|
RefreshToken(ctx context.Context, accessToken string) (*mainflux.Token, error)
|
|
}
|