goeduidiam

package module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: BSD-3-Clause Imports: 11 Imported by: 0

README

goeduidiam

Go Reference

Installation

go get github.com/masv3971/goeduidiam

Example

package main

import (
   "github.com/masv3971/goeduidiam"
)

func main() {
   ctx := context.TODO() // Make a useful context if you like
   
   iam := goeduidiam.New(goeduidiam.Config{
       URL: "example-eduid.sunet.se",
   })

   // resp is usual blank
   user, resp, err := iam.Users.Get(ctx, &goeduidiam.RequestCFG{
       ScimID: "testID",
   })
   if err != nil {
       // handle error
   }

   searchGroup, _, err := iam.Groups.Search(ctx, &goeduidiam.RequestCFG{
       Search: goeduidiam.SearchRequest{
           Schemas:    []string{},  
           Filter:     "",     
           StartIndex: 1, 
           Count       1,   
           Attributes  []string{},
   })
   if err != nil {
       // handle error
   }
}  

Make release

  1. Update RELEASE file with new tag and commit comment.
  2. $ make

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	SunetJWT *sunetjwt.Client
	Events   *EventsService
	Groups   *GroupsService
	Invites  *InvitesService
	Status   *StatusService
	Users    *UsersService
	// contains filtered or unexported fields
}

Client holds the object

func New

func New(config Config) *Client

New creates a new instance of goeduidiam

type Config

type Config struct {
	URL   string
	Token TokenConfig
}

Config holds the configuration for New

type ContactInfo

type ContactInfo struct {
	Value   string `json:"value"`
	Display string `json:"display"`
	Type    string `json:"type"`
	Primary bool   `json:"primary"`
}

ContactInfo type

type DeleteGroupsRequest added in v0.0.8

type DeleteGroupsRequest struct {
	ScimID string `validate:"required" json:"scim_id"`
}

DeleteGroupsRequest type

type DeleteInvitesRequest added in v0.0.8

type DeleteInvitesRequest struct {
	ScimID string `validate:"required" json:"scim_id"`
}

DeleteInvitesRequest type

type EmptyStruct added in v0.0.3

type EmptyStruct struct{}

EmptyStruct type

type Error added in v0.0.3

type Error interface {
	Error() string
}

Error interface

type Errors added in v0.0.3

type Errors struct {
	Detail []struct {
		Loc  []string `json:"loc"`
		Msg  string   `json:"msg"`
		Type string   `json:"type"`
	} `json:"detail"`
}

Errors is a general error reply

func (*Errors) Error added in v0.0.3

func (e *Errors) Error() string

type EventsReply

type EventsReply struct {
	ID   string `json:"id"`
	Meta Meta   `json:"meta"`
	EventsRequest
}

EventsReply type

type EventsRequest

type EventsRequest struct {
	Schemas                            []string                           `json:"schemas"`
	ExternalID                         string                             `json:"externalId"`
	HTTPSScimEduidSeSchemaNutidEventV1 HTTPSScimEduidSeSchemaNutidEventV1 `json:"https://scim.eduid.se/schema/nutid/event/v1"`
}

EventsRequest type

type EventsService

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

EventsService holds events object

func (*EventsService) Get

Get gets one event

func (*EventsService) Post

Post create a new event

type GetEventRequest added in v0.0.8

type GetEventRequest struct {
	ScimID string        `validate:"required" json:"scim_id"`
	Data   EventsRequest `validate:"required" json:"data"`
}

GetEventRequest type

type GetGroupsRequest added in v0.0.8

type GetGroupsRequest struct {
	ScimID string `validate:"required" json:"scim_id"`
}

GetGroupsRequest type

type GetInvitesRequest added in v0.0.8

type GetInvitesRequest struct {
	ScimID string `validate:"required" json:"scim_id"`
}

GetInvitesRequest type

type GetUsersRequest added in v0.0.8

type GetUsersRequest struct {
	ScimID string `validate:"required" json:"scim_id"`
}

GetUsersRequest holds the request for user

type Group

type Group struct {
	Value   string `json:"value"`
	Ref     string `json:"$ref"`
	Display string `json:"display"`
}

Group type

type GroupsReply

type GroupsReply struct {
	ID   string `json:"id"`
	Meta Meta   `json:"meta"`
	GroupsRequest
}

GroupsReply type

type GroupsRequest

type GroupsRequest struct {
	Schemas                            []string                           `validate:"required" json:"schemas"`
	ExternalID                         string                             `validate:"required" json:"externalId"`
	DisplayName                        string                             `validate:"required" json:"displayName"`
	Members                            []Member                           `validate:"required" json:"members"`
	HTTPSScimEduidSeSchemaNutidGroupV1 HTTPSScimEduidSeSchemaNutidGroupV1 `validate:"required" json:"https://scim.eduid.se/schema/nutid/group/v1"`
}

GroupsRequest type

type GroupsService

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

GroupsService holds the service for groups

func (*GroupsService) Delete

Delete deletes a group

func (*GroupsService) Get

Get gets one group

func (*GroupsService) GetAll

GetAll return all groups

func (*GroupsService) Post

Post posts a group

func (*GroupsService) Put

Put puts group

func (*GroupsService) Search

Search group

type HTTPSScimEduidSeSchemaNutidEventV1

type HTTPSScimEduidSeSchemaNutidEventV1 struct {
	Resource Resource `json:"resource"`
	Level    string   `json:"level"`
	Data     struct {
	} `json:"data"`
	ExpiresAt time.Time `json:"expiresAt"`
	Timestamp time.Time `json:"timestamp"`
	Source    string    `json:"source"`
}

HTTPSScimEduidSeSchemaNutidEventV1 type

type HTTPSScimEduidSeSchemaNutidGroupV1

type HTTPSScimEduidSeSchemaNutidGroupV1 struct {
	Data struct {
	} `json:"data"`
}

HTTPSScimEduidSeSchemaNutidGroupV1 type

type HTTPSScimEduidSeSchemaNutidUserV1

type HTTPSScimEduidSeSchemaNutidUserV1 struct {
	Profiles       Profiles        `json:"profiles"`
	LinkedAccounts []LinkedAccount `json:"linked_accounts"`
}

HTTPSScimEduidSeSchemaNutidUserV1 type

type HealthyReply added in v0.0.3

type HealthyReply struct {
	Status   string `json:"status"`
	Hostname string `json:"hostname"`
	Reason   string `json:"reason"`
}

HealthyReply type

type InvitesRequest added in v0.0.6

type InvitesRequest struct{}

InvitesRequest type

type InvitesService

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

InvitesService holds the object for Invites

func (*InvitesService) Delete

Delete deletes one invite

func (*InvitesService) Get

Get gets one invite

func (*InvitesService) Post

Post creates a new invite

func (*InvitesService) Search

Search searches for an invite

type LinkedAccount

type LinkedAccount struct {
	Issuer     string `json:"issuer"`
	Value      string `json:"value"`
	Parameters struct {
	} `json:"parameters"`
}

LinkedAccount type

type LoginRequest added in v0.0.3

type LoginRequest struct {
	DataOwner string `json:"data_owner"`
}

LoginRequest type

type Member

type Member struct {
	Value   string `json:"value"`
	Ref     string `json:"$ref"`
	Display string `json:"display"`
}

Member type

type Meta

type Meta struct {
	Location     string    `json:"location"`
	LastModified time.Time `json:"lastModified"`
	ResourceType string    `json:"resourceType"`
	Created      time.Time `json:"created"`
	Version      string    `json:"version"`
}

Meta type

type Name

type Name struct {
	FamilyName      string `json:"familyName"`
	GivenName       string `json:"givenName"`
	Formatted       string `json:"formatted"`
	MiddleName      string `json:"middleName"`
	HonorificPrefix string `json:"honorificPrefix"`
	HonorificSuffix string `json:"honorificSuffix"`
}

Name type

type PostEventsRequest added in v0.0.8

type PostEventsRequest struct {
	Data EventsRequest `validate:"required" json:"data"`
}

PostEventsRequest type

type PostGroupsRequest added in v0.0.8

type PostGroupsRequest struct {
	Data GroupsRequest `validate:"required" json:"data"`
}

PostGroupsRequest type

type PostInvitesRequest added in v0.0.8

type PostInvitesRequest struct {
	Data InvitesRequest `validate:"required" json:"data"`
}

PostInvitesRequest type

type PostUsersRequest added in v0.0.8

type PostUsersRequest struct {
	Data UsersRequest `validate:"required" json:"data"`
}

PostUsersRequest holds request for user

type Profiles

type Profiles struct {
	AdditionalProp1 Prop `json:"additionalProp1"`
	AdditionalProp2 Prop `json:"additionalProp2"`
	AdditionalProp3 Prop `json:"additionalProp3"`
}

Profiles type

type Prop

type Prop struct {
	Attributes struct {
	} `json:"attributes"`
	Data struct {
	} `json:"data"`
}

Prop type

type PutGroupsRequest added in v0.0.8

type PutGroupsRequest struct {
	ScimID string        `validate:"required" json:"scim_id"`
	Data   GroupsRequest `validate:"required" json:"data"`
}

PutGroupsRequest type

type PutUsersRequest added in v0.0.8

type PutUsersRequest struct {
	ScimID string       `validate:"required" json:"scim_id"`
	Data   UsersRequest `validate:"required" json:"data"`
}

PutUsersRequest holds request for user

type Resource

type Resource struct {
	ResourceType string    `json:"resourceType"`
	ID           string    `json:"id"`
	LastModified time.Time `json:"lastModified"`
	Version      string    `json:"version"`
	ExternalID   string    `json:"externalId"`
	Location     string    `json:"location"`
}

Resource type

type SearchGroupsRequest added in v0.0.8

type SearchGroupsRequest struct {
	Data SearchRequest `validate:"required" json:"data"`
}

SearchGroupsRequest type

type SearchInvitesRequest added in v0.0.8

type SearchInvitesRequest struct {
	Data SearchRequest `validate:"required" json:"data"`
}

SearchInvitesRequest type

type SearchReply

type SearchReply struct {
	Schemas   []string `json:"schemas"`
	Resources []struct {
	} `json:"Resources"`
	TotalResults int `json:"totalResults"`
}

SearchReply type

type SearchRequest

type SearchRequest struct {
	Schemas    []string `json:"schemas"`
	Filter     string   `json:"filter"`
	StartIndex int      `json:"startIndex"`
	Count      int      `json:"count"`
	Attributes []string `json:"attributes"`
}

SearchRequest type

type SearchUsersRequest added in v0.0.8

type SearchUsersRequest struct {
	Data SearchRequest `validate:"required" json:"data"`
}

SearchUsersRequest type

type StatusService added in v0.0.3

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

StatusService holds the object for Status

func (*StatusService) GetHealthy added in v0.0.3

func (s *StatusService) GetHealthy(ctx context.Context) (*HealthyReply, *http.Response, error)

GetHealthy gets health status

type TokenConfig added in v0.0.8

type TokenConfig struct {
	Certificate []byte
	PrivateKey  []byte
	Password    string
	Scope       string
	Type        string
	URL         string
	Key         string
	Client      string
}

TokenConfig configs token renew

type UsersReply

type UsersReply struct {
	ID   string `json:"id"`
	Meta Meta   `json:"meta"`
	UsersRequest
}

UsersReply type

type UsersRequest

type UsersRequest struct {
	Schemas                           []string                          `json:"schemas"`
	ExternalID                        string                            `json:"externalId"`
	Name                              Name                              `json:"name"`
	Emails                            []ContactInfo                     `json:"emails"`
	PhoneNumbers                      []ContactInfo                     `json:"phoneNumbers"`
	PreferredLanguage                 string                            `json:"preferredLanguage"`
	Groups                            []Group                           `json:"groups"`
	HTTPSScimEduidSeSchemaNutidUserV1 HTTPSScimEduidSeSchemaNutidUserV1 `json:"https://scim.eduid.se/schema/nutid/user/v1"`
}

UsersRequest type

type UsersService

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

UsersService holds the object for Users

func (*UsersService) Get

Get gets users from eduidIAM

func (*UsersService) Post

Post posts user

func (*UsersService) Put

Put puts on user

func (*UsersService) Search

Search searching for user

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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