Documentation ¶
Overview ¶
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *
Index ¶
- Constants
- func AddClientConnection(clientID string, stream apkmgt.EventStreamService_StreamEventsServer)
- func Base64EncodeCredentials(username, password string) string
- func CreateZipFile(writer io.Writer, zipFiles []ZipFile) error
- func DeleteAPIRevision(apiUUID string, revisionID string, body string) error
- func DeleteClientConnection(clientID string)
- func GetAllClientConnections() map[string]apkmgt.EventStreamService_StreamEventsServer
- func GetBasicAuthHeaderValue(username, password string) string
- func GetSuitableAuthHeadervalue(scopes []string) (string, error)
- func GetToken(scopes []string, clientID string, clientSecret string) (string, error)
- func GetUniqueIDOfApplicationKeyMapping(applicationUUID string, keyType string, securityScheme string, envID string, ...) string
- func GetUniqueIDOfApplicationMapping(applicationUUID string, subscriptionUUID string) string
- func ImportAPI(apiZipName string, zipFileBytes *bytes.Buffer) (string, string, error)
- func SendEvent(event *subscription.Event)
- func SendInitialEvent(srv apkmgt.EventStreamService_StreamEventsServer)
- func SendInitialEventToAllConnectedClients()
- type Scope
- type ZipFile
Constants ¶
const ( // APIImportRelativePath is the relative path of API import in publisher rest API APIImportRelativePath = "api/am/publisher/v4/apis/import?preserveProvider=false&overwrite=true&rotateRevision=true&preservePortalConfigurations=true" // TokenRelativePath is the relative path for getting token in publisher rest API TokenRelativePath = "oauth2/token" // APIDeleteRelativePath is the relative path of delete api in publisher rest API APIDeleteRelativePath = "api/am/publisher/v4/apis/" // AdminScope admin scope AdminScope Scope = "apim:admin" // ImportExportScope import export api scope ImportExportScope Scope = "apim:api_import_export" // OpenAPIDefaultYaml default open api spec yaml content OpenAPIDefaultYaml = `` /* 769-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func AddClientConnection ¶
func AddClientConnection(clientID string, stream apkmgt.EventStreamService_StreamEventsServer)
AddClientConnection adds a client connection to the map
func Base64EncodeCredentials ¶
Base64EncodeCredentials encodes the given username and password into a base64 string.
func CreateZipFile ¶
CreateZipFile creates a zip file using the provided io.Writer. It takes a slice of ZipFile structs containing information about the files to be added to the zip. Each ZipFile struct specifies the file path within the zip and its content. It returns an error if any operation fails.
func DeleteAPIRevision ¶
DeleteAPIRevision deletes an API given its UUID.
func DeleteClientConnection ¶
func DeleteClientConnection(clientID string)
DeleteClientConnection deletes a client connection from the map
func GetAllClientConnections ¶
func GetAllClientConnections() map[string]apkmgt.EventStreamService_StreamEventsServer
GetAllClientConnections returns all client connections
func GetBasicAuthHeaderValue ¶
GetBasicAuthHeaderValue constructs and returns the Basic authentication header value using the provided username and password.
func GetSuitableAuthHeadervalue ¶
GetSuitableAuthHeadervalue returns an appropriate authentication header value based on whether client credentials are provided.
func GetUniqueIDOfApplicationKeyMapping ¶
func GetUniqueIDOfApplicationKeyMapping(applicationUUID string, keyType string, securityScheme string, envID string, organization string) string
GetUniqueIDOfApplicationKeyMapping returns the unique id of an application key mapping
func GetUniqueIDOfApplicationMapping ¶
GetUniqueIDOfApplicationMapping returns the unique id of an application mapping
func SendEvent ¶
func SendEvent(event *subscription.Event)
SendEvent sends event to the common-controllers
func SendInitialEvent ¶
func SendInitialEvent(srv apkmgt.EventStreamService_StreamEventsServer)
SendInitialEvent sends initial event to the enforcer
func SendInitialEventToAllConnectedClients ¶
func SendInitialEventToAllConnectedClients()
SendInitialEventToAllConnectedClients sends initial event to all connected clients