Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApiAuthInfo ¶
type ApiAuthInfo struct { // Authorization record ID. ID string `json:"id"` // The API ID. ApiId string `json:"api_id"` // The API name. ApiName string `json:"api_name"` // Name of the API group to which the API belongs. GroupName string `json:"group_name"` // API type. ApiType int `json:"api_type"` // API description. ApiRemark string `json:"api_remark"` // ID of the environment in which an app has been authorized to call the API. EnvId string `json:"env_id"` // Authorizer. AuthRole string `json:"auth_role"` // Authorization time. AuthTime string `json:"auth_time"` // Application name. AppName string `json:"app_name"` // Application description. AppRemark string `json:"app_remark"` // Application type. AppType string `json:"app_type"` // Creator of the app. // + USER: The app is created by a tenant. // + MARKET: The app is allocated by KooGallery. AppCreator string `json:"app_creator"` // API publication record ID. PublishId string `json:"publish_id"` // ID of the API group to which the API belongs. GroupId string `json:"group_id"` // Authorization channel type. // + NORMAL: normal channel // + GREEN: green channel AuthTunnel string `json:"auth_tunnel"` // Whitelist for the green channel. AuthWhitelist []string `json:"auth_whitelist"` // Blacklist for the green channel. AuthBlacklist []string `json:"auth_blacklist"` // Access parameters. VisitParams string `json:"visit_params"` // ROMA application type. // + subscription: subscription application // + integration: integration application RomaAppType string `json:"roma_app_type"` // Name of the environment in which the app has been authorized to call the API. EnvName string `json:"env_name"` // Application ID. AppId string `json:"app_id"` }
ApiAuthInfo is the structure that represents the authorized API information.
func ExtractAuthorizedApis ¶
func ExtractAuthorizedApis(r pagination.Page) ([]ApiAuthInfo, error)
ExtractAuthorizedApis is a method to extract the list of authorized APIs for specified application.
func ListAuthorized ¶
func ListAuthorized(c *golangsdk.ServiceClient, opts ListOpts) ([]ApiAuthInfo, error)
List is a method to obtain the authorized API list under a specified application using given parameters.
type ApiOutlineInfo ¶
type ApiOutlineInfo struct { // API authentication mode. AuthType string `json:"auth_type"` // Name of the environment in which the API has been published. RunEnvName string `json:"run_env_name"` // Name of the API group to which the API belongs. GroupName string `json:"group_name"` // Publication record ID. PublishId string `json:"publish_id"` // ID of the API group to which the API belongs. GroupId string `json:"group_id"` // API name. Name string `json:"name"` // API description. Remark string `json:"remark"` // ID of the environment in which the API has been published. RunEnvId string `json:"run_env_id"` // Application ID. ID string `json:"id"` // API request address. ReqUri string `json:"req_uri"` }
ApiOutlineInfo is the structure that represents the unauthorized API information.
func ExtractUnauthorizedApis ¶
func ExtractUnauthorizedApis(r pagination.Page) ([]ApiOutlineInfo, error)
ExtractUnauthorizedApis is a method to extract the list of unauthorized APIs for specified application.
func ListUnauthorized ¶
func ListUnauthorized(c *golangsdk.ServiceClient, opts ListOpts) ([]ApiOutlineInfo, error)
List is a method to obtain the unauthorized API list under a specified application using given parameters.
type AuthResult ¶
type AuthResult struct { // Authorization result. // + SUCCESS // + SKIPPED // + FAILED Status string `json:"status"` // Error message. ErrorMsg string `json:"error_msg"` // Error code. ErrorCode string `json:"error_code"` // Name of the API for which authorization fails. ApiName string `json:"api_name"` // Name of the app that fails to be authorized. AppName string `json:"app_name"` }
AuthResult is the structure that represents the authorization details.
type Authorization ¶
type Authorization struct { // The application ID. ApiId string `json:"api_id"` // The authorization result. AuthResult AuthResult `json:"auth_result"` // The authorization time. AuthTime string `json:"auth_time"` // The authorization record ID. ID string `json:"id"` // The ID of the application allowed to access the API. AppId string `json:"app_id"` // The authorizer. // + PROVIDER: API provider // + CONSUMER: API user AuthRole string `json:"auth_role"` // Authorization channel type. // + NORMAL: normal channel // + GREEN: green channel // The default value is NORMAL. AuthTunnel string `json:"auth_tunnel"` // Whitelist for the green channel. AuthWhitelist []string `json:"auth_whitelist"` // Blacklist for the green channel. AuthBlacklist []string `json:"auth_blacklist"` // Access parameters. VisitParams string `json:"visit_params"` }
Authorization is the struct that represents the application authorization records.
func Create ¶
func Create(c *golangsdk.ServiceClient, opts CreateOpts) ([]Authorization, error)
Create is a method used to authorize APIs to allow applications access using given parameters.
type AuthorizedPage ¶
type AuthorizedPage struct {
pagination.OffsetPageBase
}
AuthorizedPage is a page structure that represents each page information.
func (AuthorizedPage) IsEmpty ¶
func (b AuthorizedPage) IsEmpty() (bool, error)
IsEmpty checks whether a AuthorizedPage struct is empty.
type CreateOpts ¶
type CreateOpts struct { // The Dedicated instance ID. InstanceId string `json:"-" required:"true"` // The ID of the environment in which the apps will be authorized. EnvId string `json:"env_id" required:"true"` // The ID list of the applications authorized to access the APIs. AppIds []string `json:"app_ids" required:"true"` // The authorized API IDs. ApiIds []string `json:"api_ids" required:"true"` }
CreateOpts is the structure that used to authorize APIs to allow applications access.
type ListOpts ¶
type ListOpts struct { // The instnace ID to which the application and APIs belong. InstanceId string `json:"-" required:"true"` // The application ID. AppId string `q:"app_id" required:"true"` // Offset from which the query starts. // If the offset is less than 0, the value is automatically converted to 0. Default to 0. Offset int `q:"offset"` // Number of items displayed on each page. The valid values are range form 1 to 500, default to 20. Limit int `q:"limit"` // The authorized API ID. ApiId string `q:"app_id"` // The authorized API name. ApiName string `q:"api_name"` // The ID of the API group to which the authorized APIs belong. GroupId string `q:"group_id"` // The name of the API group to which the authorized APIs belong. GroupName string `q:"group_name"` // Parameter name (only 'name' is supported) for exact matching. EnvId string `q:"env_id"` }
ListOpts is the structure used to querying authorized and unauthorized API information.
type UnauthorizedPage ¶
type UnauthorizedPage struct {
}UnauthorizedPage is a page structure that represents each page information.
func (UnauthorizedPage) IsEmpty ¶
func (b UnauthorizedPage) IsEmpty() (bool, error)
IsEmpty checks whether a UnauthorizedPage struct is empty.