Documentation
¶
Index ¶
- Variables
- func NewCertPool() *x509.CertPool
- type Client
- func (c *Client) GetEndUserLicense(ctx context.Context, license []byte) (*EndUserLicense, []byte, *http.Response, error)
- func (c *Client) ListTemplates(ctx context.Context) ([]Template, *http.Response, error)
- func (c *Client) NewRequest(ctx context.Context, method string, path string, body io.Reader) (*http.Request, error)
- type EndUserLicense
- type Key
- type Policy
- type Template
- type UserRight
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultBaseURL *url.URL
Client uses DefaultBaseURL if not specified
Functions ¶
func NewCertPool ¶
NewCertPool creates a *x509.CertPool which contains "Microsoft Root Certificate Authority 2011" (used by api.aadrm.com)
Types ¶
type Client ¶
type Client struct { // BaseURL is DefaultBaseURL if unspecified BaseURL *url.URL // Becomes the X-MS-RMS-Platform-Id header if set RMSPlatformID string // Becomes User-Agent header if set UserAgent string // contains filtered or unexported fields }
Client interacts with aadrm
func NewClient ¶
NewClient creates a client, the caller must supply a client with auth (ex: via oauth2.TokenSource)
func (*Client) GetEndUserLicense ¶
func (c *Client) GetEndUserLicense(ctx context.Context, license []byte) (*EndUserLicense, []byte, *http.Response, error)
GetEndUserLicense calls /my/v2/enduserlicenses
func (*Client) ListTemplates ¶
ListTemplates calls /my/v2/templates
type EndUserLicense ¶
type EndUserLicense struct { ID *string `json:"Id,omitempty"` Name *string `json:"Name,omitempty"` Description *string `json:"Description,omitempty"` Referrer *string `json:"Referrer,omitempty"` Owner *string `json:"Owner,omitempty"` AccessStatus *string `json:"AccessStatus,omitempty"` Key *Key `json:"Key,omitempty"` Rights []string `json:"Rights,omitempty"` Roles []string `json:"Roles,omitempty"` IssuedTo *string `json:"IssuedTo,omitempty"` ContentValidUntil *string `json:"ContentValidUntil,omitempty"` LicenseValidUntil *string `json:"LicenseValidUntil,omitempty"` ContentID *string `json:"ContentId,omitempty"` DocumentID *string `json:"DocumentId,omitempty"` LabelID *string `json:"LabelId,omitempty"` OnlineAccessOnly *bool `json:"OnlineAccessOnly,omitempty"` SignedApplicationData map[string]json.RawMessage `json:"SignedApplicationData,omitempty"` EncryptedApplicationData map[string]json.RawMessage `json:"EncryptedApplicationData,omitempty"` FromTemplate *bool `json:"FromTemplate,omitempty"` Policy *Policy `json:"Policy,omitempty"` ErrorMessage *string `json:"ErrorMessage,omitempty"` }
func DecodeEndUserLicense ¶
func DecodeEndUserLicense(r io.Reader) (*EndUserLicense, error)
DecodeEndUserLicense decodes a *EndUserLicense from a io.Reader
func (*EndUserLicense) String ¶
func (l *EndUserLicense) String() string
type Key ¶
type Policy ¶
type Policy struct { AllowAuditedExtraction *bool `json:"AllowAuditedExtraction,omitempty"` UserRoles []string `json:"UserRoles,omitempty"` UserRights []UserRight `json:"UserRights,omitempty"` IntervalTimeInDays *int `json:"IntervalTimeInDays,omitempty"` LicenseValidUntil *string `json:"LicenseValidUntil,omitempty"` }
Click to show internal directories.
Click to hide internal directories.