Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial authorize sdk module #55

Merged
merged 1 commit into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions authorize/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

.travis.yml
git_push.sh
.gitignore
CHANGELOG.md
GNUmakefile
.version
56 changes: 56 additions & 0 deletions authorize/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
README.md
api/openapi.yaml
api_api_servers.go
api_policy_decision_management.go
client.go
configuration.go
docs/APIServer.md
docs/APIServerAuthorizationServer.md
docs/APIServerAuthorizationServerResource.md
docs/APIServerOperations.md
docs/APIServerOperationsValue.md
docs/APIServerOperationsValueAccessControl.md
docs/APIServerOperationsValueAccessControlGroup.md
docs/APIServerOperationsValueAccessControlGroupGroupsInner.md
docs/APIServerOperationsValuePathsInner.md
docs/APIServersApi.md
docs/DecisionEndpoint.md
docs/DecisionEndpointAuthorizationVersion.md
docs/DecisionEndpointRecentDecisions.md
docs/EntityArray.md
docs/EntityArrayEmbedded.md
docs/EnumAPIServerPatternType.md
docs/ObjectApplication.md
docs/ObjectEnvironment.md
docs/ObjectOrganization.md
docs/ObjectPopulation.md
docs/P1Error.md
docs/P1ErrorDetailsInner.md
docs/P1ErrorDetailsInnerInnerError.md
docs/PolicyDecisionManagementApi.md
go.mod
go.sum
model_api_server.go
model_api_server_authorization_server.go
model_api_server_authorization_server_resource.go
model_api_server_operations.go
model_api_server_operations_value.go
model_api_server_operations_value_access_control.go
model_api_server_operations_value_access_control_group.go
model_api_server_operations_value_access_control_group_groups_inner.go
model_api_server_operations_value_paths_inner.go
model_decision_endpoint.go
model_decision_endpoint_authorization_version.go
model_decision_endpoint_recent_decisions.go
model_entity_array.go
model_entity_array__embedded.go
model_enum_api_server_pattern_type.go
model_object_application.go
model_object_environment.go
model_object_organization.go
model_object_population.go
model_p1_error.go
model_p1_error_details_inner.go
model_p1_error_details_inner_inner_error.go
response.go
utils.go
1 change: 1 addition & 0 deletions authorize/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.0.1
1 change: 1 addition & 0 deletions authorize/.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
3 changes: 3 additions & 0 deletions authorize/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# v0.1.0 (Unreleased)

Initial release
35 changes: 35 additions & 0 deletions authorize/GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
TEST?=$$(go list ./...)

default: build

build: fmtcheck
go build

test: fmtcheck
go test $(TEST) $(TESTARGS) -timeout=5m

testacc: fmtcheck
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m

vet:
@echo "==> Running go vet..."
@go vet ./... ; if [ $$? -ne 0 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
exit 1; \
fi

depscheck:
@echo "==> Checking source code with go mod tidy..."
@go mod tidy
@git diff --exit-code -- go.mod go.sum || \
(echo; echo "Unexpected difference in go.mod/go.sum files. Run 'go mod tidy' command or revert any go.mod/go.sum changes and commit."; exit 1)

lint: golangci-lint

golangci-lint:
@echo "==> Checking source code with golangci-lint..."
@golangci-lint run ./...

.PHONY: build test testacc vet fmtcheck depscheck lint golangci-lint
154 changes: 154 additions & 0 deletions authorize/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Go API client for authorize

The PingOne Platform API covering the PingOne Authorize service

## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.

- API version: 2022-09-23
- Package version: 0.1.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen

## Installation

Install the following dependencies:

```shell
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
```

Put the package under your project folder and add the following in import:

```golang
import authorize "github.com/patrickcping/pingone-go-sdk-v2/authorize"
```

To use a proxy, set the environment variable `HTTP_PROXY`:

```golang
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
```

## Configuration of Server URL

Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification.

### Select Server Configuration

For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`.

```golang
ctx := context.WithValue(context.Background(), authorize.ContextServerIndex, 1)
```

### Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`.

```golang
ctx := context.WithValue(context.Background(), authorize.ContextServerVariables, map[string]string{
"basePath": "v2",
})
```

Note, enum values are always validated and all unused variables are silently ignored.

### URLs Configuration per Operation

Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.

```
ctx := context.WithValue(context.Background(), authorize.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), authorize.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
```

## Documentation for API Endpoints

All URIs are relative to *https://api.pingone.eu*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*APIServersApi* | [**CreateAPIServer**](docs/APIServersApi.md#createapiserver) | **Post** /v1/environments/{environmentID}/apiServers | CREATE API Server
*APIServersApi* | [**DeleteAPIServer**](docs/APIServersApi.md#deleteapiserver) | **Delete** /v1/environments/{environmentID}/apiServers/{apiServerID} | DELETE API Server
*APIServersApi* | [**ReadAllAPIServers**](docs/APIServersApi.md#readallapiservers) | **Get** /v1/environments/{environmentID}/apiServers | READ All API Servers
*APIServersApi* | [**ReadOneAPIServer**](docs/APIServersApi.md#readoneapiserver) | **Get** /v1/environments/{environmentID}/apiServers/{apiServerID} | READ One API Server
*APIServersApi* | [**UpdateAPIServer**](docs/APIServersApi.md#updateapiserver) | **Put** /v1/environments/{environmentID}/apiServers/{apiServerID} | UPDATE API Server
*PolicyDecisionManagementApi* | [**CreateDecisionEndpoint**](docs/PolicyDecisionManagementApi.md#createdecisionendpoint) | **Post** /v1/environments/{environmentID}/decisionEndpoints | CREATE Decision Endpoint
*PolicyDecisionManagementApi* | [**DeleteDecisionEndpoint**](docs/PolicyDecisionManagementApi.md#deletedecisionendpoint) | **Delete** /v1/environments/{environmentID}/decisionEndpoints/{decisionEndpointID} | DELETE Decision Endpoint
*PolicyDecisionManagementApi* | [**ReadAllDecisionEndpoints**](docs/PolicyDecisionManagementApi.md#readalldecisionendpoints) | **Get** /v1/environments/{environmentID}/decisionEndpoints | READ All Decision Endpoints
*PolicyDecisionManagementApi* | [**ReadOneDecisionEndpoint**](docs/PolicyDecisionManagementApi.md#readonedecisionendpoint) | **Get** /v1/environments/{environmentID}/decisionEndpoints/{decisionEndpointID} | READ One Decision Endpoint
*PolicyDecisionManagementApi* | [**UpdateDecisionEndpoint**](docs/PolicyDecisionManagementApi.md#updatedecisionendpoint) | **Put** /v1/environments/{environmentID}/decisionEndpoints/{decisionEndpointID} | UPDATE Decision Endpoint


## Documentation For Models

- [APIServer](docs/APIServer.md)
- [APIServerAuthorizationServer](docs/APIServerAuthorizationServer.md)
- [APIServerAuthorizationServerResource](docs/APIServerAuthorizationServerResource.md)
- [APIServerOperations](docs/APIServerOperations.md)
- [APIServerOperationsValue](docs/APIServerOperationsValue.md)
- [APIServerOperationsValueAccessControl](docs/APIServerOperationsValueAccessControl.md)
- [APIServerOperationsValueAccessControlGroup](docs/APIServerOperationsValueAccessControlGroup.md)
- [APIServerOperationsValueAccessControlGroupGroupsInner](docs/APIServerOperationsValueAccessControlGroupGroupsInner.md)
- [APIServerOperationsValuePathsInner](docs/APIServerOperationsValuePathsInner.md)
- [DecisionEndpoint](docs/DecisionEndpoint.md)
- [DecisionEndpointAuthorizationVersion](docs/DecisionEndpointAuthorizationVersion.md)
- [DecisionEndpointRecentDecisions](docs/DecisionEndpointRecentDecisions.md)
- [EntityArray](docs/EntityArray.md)
- [EntityArrayEmbedded](docs/EntityArrayEmbedded.md)
- [EnumAPIServerPatternType](docs/EnumAPIServerPatternType.md)
- [ObjectApplication](docs/ObjectApplication.md)
- [ObjectEnvironment](docs/ObjectEnvironment.md)
- [ObjectOrganization](docs/ObjectOrganization.md)
- [ObjectPopulation](docs/ObjectPopulation.md)
- [P1Error](docs/P1Error.md)
- [P1ErrorDetailsInner](docs/P1ErrorDetailsInner.md)
- [P1ErrorDetailsInnerInnerError](docs/P1ErrorDetailsInnerInnerError.md)


## Documentation For Authorization



### bearer

- **Type**: HTTP Bearer token authentication

Example

```golang
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)
```


## Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains
a number of utility functions to easily obtain pointers to values of basic types.
Each of these functions takes a value of the given basic type and returns a pointer to it:

* `PtrBool`
* `PtrInt`
* `PtrInt32`
* `PtrInt64`
* `PtrFloat`
* `PtrFloat32`
* `PtrFloat64`
* `PtrString`
* `PtrTime`

## Author



Loading