Skip to content

Latest commit

 

History

History
289 lines (184 loc) · 7.75 KB

File metadata and controls

289 lines (184 loc) · 7.75 KB

\PermissionsApi

All URIs are relative to http://localhost

Method HTTP request Description
DescribePermissions Get /security/permissions/{subject} Describe permissions
GetPermissions Get /security/permissions/list List permissions
GrantPermissions Post /security/permissions/{subject} Grant permissions
RevokePermissions Delete /security/permissions/{subject} Revoke permissions

DescribePermissions

PermissionDescription DescribePermissions(ctx, subject).Resource(resource).Permission(permission).Execute()

Describe permissions

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    subject := "subject_example" // string | 
    resource := "resource_example" // string |  (optional)
    permission := "permission_example" // string |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PermissionsApi.DescribePermissions(context.Background(), subject).Resource(resource).Permission(permission).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PermissionsApi.DescribePermissions``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DescribePermissions`: PermissionDescription
    fmt.Fprintf(os.Stdout, "Response from `PermissionsApi.DescribePermissions`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
subject string

Other Parameters

Other parameters are passed through a pointer to a apiDescribePermissionsRequest struct via the builder pattern

Name Type Description Notes

resource | string | | permission | string | |

Return type

PermissionDescription

Authorization

ApiToken, ServiceBearer, ServiceToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetPermissions

Permissions GetPermissions(ctx).Execute()

List permissions

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PermissionsApi.GetPermissions(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PermissionsApi.GetPermissions``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetPermissions`: Permissions
    fmt.Fprintf(os.Stdout, "Response from `PermissionsApi.GetPermissions`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetPermissionsRequest struct via the builder pattern

Return type

Permissions

Authorization

ApiToken, ServiceBearer, ServiceToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GrantPermissions

GrantPermissions(ctx, subject).GrantPermission(grantPermission).Execute()

Grant permissions

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    subject := "subject_example" // string | 
    grantPermission := *openapiclient.NewGrantPermission("Permission_example", "ResourceName_example") // GrantPermission | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PermissionsApi.GrantPermissions(context.Background(), subject).GrantPermission(grantPermission).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PermissionsApi.GrantPermissions``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
subject string

Other Parameters

Other parameters are passed through a pointer to a apiGrantPermissionsRequest struct via the builder pattern

Name Type Description Notes

grantPermission | GrantPermission | |

Return type

(empty response body)

Authorization

ApiToken, ServiceBearer, ServiceToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RevokePermissions

RevokePermissions(ctx, subject).Resource(resource).Permission(permission).Execute()

Revoke permissions

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    subject := "subject_example" // string | 
    resource := "resource_example" // string |  (optional)
    permission := "permission_example" // string |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PermissionsApi.RevokePermissions(context.Background(), subject).Resource(resource).Permission(permission).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PermissionsApi.RevokePermissions``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
subject string

Other Parameters

Other parameters are passed through a pointer to a apiRevokePermissionsRequest struct via the builder pattern

Name Type Description Notes

resource | string | | permission | string | |

Return type

(empty response body)

Authorization

ApiToken, ServiceBearer, ServiceToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]