nextcloud

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNextcloudServerMock

func GetNextcloudServerMock(called *[]string) http.Handler

GetNextcloudServerMock returns a handler that pretends to be a remote Nextcloud server.

func New

func New(ctx context.Context, m map[string]interface{}) (user.Manager, error)

New returns a user manager implementation that reads a json file to provide user metadata.

func TestingHTTPClient

func TestingHTTPClient(handler http.Handler) (*http.Client, func())

TestingHTTPClient thanks to https://itnext.io/how-to-stub-requests-to-remote-hosts-with-go-6c2c1db32bf2 Ideally, this function would live in tests/helpers, but if we put it there, it gets excluded by .dockerignore, and the Docker build fails (see https://github.com/cs3org/reva/issues/1999) So putting it here for now - open to suggestions if someone knows a better way to inject this.

Types

type Action

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

Action describes a REST request to forward to the Nextcloud backend.

type Manager

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

Manager is the Nextcloud-based implementation of the share.Manager interface see https://github.com/cs3org/reva/blob/v1.13.0/pkg/user/user.go#L29-L35

func NewUserManager

func NewUserManager(c *UserManagerConfig) (*Manager, error)

NewUserManager returns a new Nextcloud-based UserManager.

func (*Manager) Configure

func (um *Manager) Configure(ml map[string]interface{}) error

Configure method as defined in https://github.com/cs3org/reva/blob/v1.13.0/pkg/user/user.go#L29-L35

func (*Manager) FindUsers

func (um *Manager) FindUsers(ctx context.Context, query string, skipFetchingGroups bool) ([]*userpb.User, error)

FindUsers method as defined in https://github.com/cs3org/reva/blob/v1.13.0/pkg/user/user.go#L29-L35

func (*Manager) GetUser

func (um *Manager) GetUser(ctx context.Context, uid *userpb.UserId, skipFetchingGroups bool) (*userpb.User, error)

GetUser method as defined in https://github.com/cs3org/reva/blob/v1.13.0/pkg/user/user.go#L29-L35

func (*Manager) GetUserByClaim

func (um *Manager) GetUserByClaim(ctx context.Context, claim, value string, skipFetchingGroups bool) (*userpb.User, error)

GetUserByClaim method as defined in https://github.com/cs3org/reva/blob/v1.13.0/pkg/user/user.go#L29-L35

func (*Manager) GetUserGroups

func (um *Manager) GetUserGroups(ctx context.Context, uid *userpb.UserId) ([]string, error)

GetUserGroups method as defined in https://github.com/cs3org/reva/blob/v1.13.0/pkg/user/user.go#L29-L35

func (*Manager) SetHTTPClient

func (um *Manager) SetHTTPClient(c *http.Client)

SetHTTPClient sets the HTTP client.

type Response

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

Response contains data for the Nextcloud mock server to respond and to switch to a new server state.

type UserManagerConfig

type UserManagerConfig struct {
	EndPoint     string `docs:";The Nextcloud backend endpoint for user management" mapstructure:"endpoint"`
	SharedSecret string `mapstructure:"shared_secret"`
	MockHTTP     bool   `mapstructure:"mock_http"`
}

UserManagerConfig contains config for a Nextcloud-based UserManager.

func (*UserManagerConfig) ApplyDefaults added in v1.25.0

func (c *UserManagerConfig) ApplyDefaults()

Jump to

Keyboard shortcuts

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