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

not all channels configuraiton implmented in the sdk #469

Open
AdamRussak opened this issue Jun 23, 2024 · 3 comments
Open

not all channels configuraiton implmented in the sdk #469

AdamRussak opened this issue Jun 23, 2024 · 3 comments
Labels
bug Something isn't working Triaged

Comments

@AdamRussak
Copy link

Describe the bug?

there is no Conig implementation in InlineHookChannel struct the okta v4 sdk

What is expected to happen?

when createing an inline hook you should be able to create a InlineHookChannel with channel config:
github.com/okta/okta-sdk-golang/v4@v4.1.2/okta/model_inline_hook_channel_config.go

but this struct is not used by any function

What is the actual behavior?

you cannot create an inline hook using any other than the basic configuration github.com/okta/okta-sdk-golang/v4@v4.1.2/okta/api_inline_hook.go

Reproduction Steps?

try to create an inline hook with this body:

{
    "name": "OIDC/OAuth token inline hook",
    "type": "com.okta.oauth2.tokens.transform",
    "version": "1.0.0",
    "channel": {
        "type": "HTTP",
        "version": "1.0.0",
        "config": {
            "uri": "https://example.com",
            "headers": [
            	{
					"key": "x-any-key",
					"value": "my-header-value"
				}
            ],
            "method": "POST",
            "authScheme": {
                "type": "HEADER",
                "key": "Authorization",
                "value": "my-shared-secret"
            }
        }
    }
}

as provided in the example in the okta offical docs.

Additional Information?

example (not working)

	body := getInlinehookBody(cr.Spec.ForProvider)
OktaCli.InlineHookAPI.CreateInlineHook(ctx).InlineHook(*body).Execute()

body creation:

func getInlinehookBody(spec *inlinehookv1alpha1.InlinehookParameters) *okta.InlineHook {
	inlinbody := okta.NewInlineHook()
	inlinbody.SetName(*spec.Name)
	// inlinbody.SetStatus(*spec.Status)
	channelBody := getChannelBody(spec.Channel)
	inlinbody.SetChannel(*channelBody)
	inlinbody.SetType(*spec.Type)
	inlinbody.SetVersion(*spec.Version)

	return inlinbody
}
func getChannelBody(spec *inlinehookv1alpha1.InlineHookChannel) *okta.InlineHookChannel {
	newChannel := okta.NewInlineHookChannel()
	if !helpers.IsZero(spec.Config) {
		configParam := helpers.StructToMap(spec.Config)
		newChannel.AdditionalProperties["Config"] = configParam
	}
	newChannel.SetType(*spec.Type)
	newChannel.SetVersion(*spec.Version)
	return newChannel
}

Golang Version

go version go1.22.4 darwin/amd64

SDK Version

4.1.2

OS version

Darwin ilnesahprib48cb 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:09:52 PDT 2024; root:xnu-10063.121.3~5/RELEASE_X86_64 x86_64

@AdamRussak AdamRussak added the bug Something isn't working label Jun 23, 2024
@duytiennguyen-okta
Copy link
Contributor

OKTA internal reference https://oktainc.atlassian.net/browse/OKTA-742339

@AdamRussak
Copy link
Author

OKTA internal reference https://oktainc.atlassian.net/browse/OKTA-742339

I don't have access to the jira

@AdamRussak
Copy link
Author

OKTA internal reference https://oktainc.atlassian.net/browse/OKTA-742339

how can i see the ticket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Triaged
Projects
None yet
Development

No branches or pull requests

2 participants