Skip to content

Commit 4c19f5a

Browse files
authored
Merge branch 'master' into v1.7155.0
2 parents 0395f27 + 1a90849 commit 4c19f5a

File tree

2 files changed

+266
-2
lines changed

2 files changed

+266
-2
lines changed

cmd/scw-sweeper/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
flexibleipSweeper "github.com/scaleway/scaleway-sdk-go/api/flexibleip/v1alpha1/sweepers"
1515
functionSweeper "github.com/scaleway/scaleway-sdk-go/api/function/v1beta1/sweepers"
1616
iamSweeper "github.com/scaleway/scaleway-sdk-go/api/iam/v1alpha1/sweepers"
17-
inferenceSweeper "github.com/scaleway/scaleway-sdk-go/api/inference/v1beta1/sweepers"
17+
inferenceSweeper "github.com/scaleway/scaleway-sdk-go/api/inference/v1/sweepers"
1818
instanceSweeper "github.com/scaleway/scaleway-sdk-go/api/instance/v1/sweepers"
1919
iotSweeper "github.com/scaleway/scaleway-sdk-go/api/iot/v1/sweepers"
2020
ipamSweeper "github.com/scaleway/scaleway-sdk-go/api/ipam/v1/sweepers"

internal/namespaces/iam/v1alpha1/iam_cli.go

Lines changed: 265 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ func GetGeneratedCommands() *core.Commands {
3131
iamJwt(),
3232
iamLog(),
3333
iamOrganization(),
34+
iamSaml(),
35+
iamSamlCertificates(),
3436
iamSSHKeyList(),
3537
iamSSHKeyCreate(),
3638
iamSSHKeyGet(),
@@ -76,6 +78,13 @@ func GetGeneratedCommands() *core.Commands {
7678
iamJwtDelete(),
7779
iamLogList(),
7880
iamLogGet(),
81+
iamOrganizationGetSaml(),
82+
iamOrganizationEnableSaml(),
83+
iamSamlUpdate(),
84+
iamSamlDelete(),
85+
iamSamlCertificatesList(),
86+
iamSamlCertificatesAdd(),
87+
iamSamlCertificatesDelete(),
7988
)
8089
}
8190

@@ -186,6 +195,24 @@ func iamOrganization() *core.Command {
186195
}
187196
}
188197

198+
func iamSaml() *core.Command {
199+
return &core.Command{
200+
Short: `SAML management commands`,
201+
Long: `SAML management commands.`,
202+
Namespace: "iam",
203+
Resource: "saml",
204+
}
205+
}
206+
207+
func iamSamlCertificates() *core.Command {
208+
return &core.Command{
209+
Short: `SAML Certificates management commands`,
210+
Long: `SAML Certificates management commands.`,
211+
Namespace: "iam",
212+
Resource: "saml-certificates",
213+
}
214+
}
215+
189216
func iamSSHKeyList() *core.Command {
190217
return &core.Command{
191218
Short: `List SSH keys`,
@@ -512,7 +539,6 @@ func iamUserList() *core.Command {
512539
Positional: false,
513540
EnumValues: []string{
514541
"unknown_type",
515-
"guest",
516542
"owner",
517543
"member",
518544
},
@@ -2636,3 +2662,241 @@ func iamLogGet() *core.Command {
26362662
},
26372663
}
26382664
}
2665+
2666+
func iamOrganizationGetSaml() *core.Command {
2667+
return &core.Command{
2668+
Short: `Get SAML Identity Provider configuration of an Organization`,
2669+
Long: `Get SAML Identity Provider configuration of an Organization.`,
2670+
Namespace: "iam",
2671+
Resource: "organization",
2672+
Verb: "get-saml",
2673+
// Deprecated: false,
2674+
ArgsType: reflect.TypeOf(iam.GetOrganizationSamlRequest{}),
2675+
ArgSpecs: core.ArgSpecs{
2676+
core.OrganizationIDArgSpec(),
2677+
},
2678+
Run: func(ctx context.Context, args any) (i any, e error) {
2679+
request := args.(*iam.GetOrganizationSamlRequest)
2680+
2681+
client := core.ExtractClient(ctx)
2682+
api := iam.NewAPI(client)
2683+
2684+
return api.GetOrganizationSaml(request)
2685+
},
2686+
}
2687+
}
2688+
2689+
func iamOrganizationEnableSaml() *core.Command {
2690+
return &core.Command{
2691+
Short: `Enable SAML Identity Provider for an Organization`,
2692+
Long: `Enable SAML Identity Provider for an Organization.`,
2693+
Namespace: "iam",
2694+
Resource: "organization",
2695+
Verb: "enable-saml",
2696+
// Deprecated: false,
2697+
ArgsType: reflect.TypeOf(iam.EnableOrganizationSamlRequest{}),
2698+
ArgSpecs: core.ArgSpecs{
2699+
core.OrganizationIDArgSpec(),
2700+
},
2701+
Run: func(ctx context.Context, args any) (i any, e error) {
2702+
request := args.(*iam.EnableOrganizationSamlRequest)
2703+
2704+
client := core.ExtractClient(ctx)
2705+
api := iam.NewAPI(client)
2706+
2707+
return api.EnableOrganizationSaml(request)
2708+
},
2709+
}
2710+
}
2711+
2712+
func iamSamlUpdate() *core.Command {
2713+
return &core.Command{
2714+
Short: `Update SAML Identity Provider configuration`,
2715+
Long: `Update SAML Identity Provider configuration.`,
2716+
Namespace: "iam",
2717+
Resource: "saml",
2718+
Verb: "update",
2719+
// Deprecated: false,
2720+
ArgsType: reflect.TypeOf(iam.UpdateSamlRequest{}),
2721+
ArgSpecs: core.ArgSpecs{
2722+
{
2723+
Name: "saml-id",
2724+
Short: `ID of the SAML configuration`,
2725+
Required: true,
2726+
Deprecated: false,
2727+
Positional: true,
2728+
},
2729+
{
2730+
Name: "entity-id",
2731+
Short: `Entity ID of the SAML Identity Provider`,
2732+
Required: false,
2733+
Deprecated: false,
2734+
Positional: false,
2735+
},
2736+
{
2737+
Name: "single-sign-on-url",
2738+
Short: `Single Sign-On URL of the SAML Identity Provider`,
2739+
Required: false,
2740+
Deprecated: false,
2741+
Positional: false,
2742+
},
2743+
},
2744+
Run: func(ctx context.Context, args any) (i any, e error) {
2745+
request := args.(*iam.UpdateSamlRequest)
2746+
2747+
client := core.ExtractClient(ctx)
2748+
api := iam.NewAPI(client)
2749+
2750+
return api.UpdateSaml(request)
2751+
},
2752+
}
2753+
}
2754+
2755+
func iamSamlDelete() *core.Command {
2756+
return &core.Command{
2757+
Short: `Disable SAML Identity Provider for an Organization`,
2758+
Long: `Disable SAML Identity Provider for an Organization.`,
2759+
Namespace: "iam",
2760+
Resource: "saml",
2761+
Verb: "delete",
2762+
// Deprecated: false,
2763+
ArgsType: reflect.TypeOf(iam.DeleteSamlRequest{}),
2764+
ArgSpecs: core.ArgSpecs{
2765+
{
2766+
Name: "saml-id",
2767+
Short: `ID of the SAML configuration`,
2768+
Required: true,
2769+
Deprecated: false,
2770+
Positional: true,
2771+
},
2772+
},
2773+
Run: func(ctx context.Context, args any) (i any, e error) {
2774+
request := args.(*iam.DeleteSamlRequest)
2775+
2776+
client := core.ExtractClient(ctx)
2777+
api := iam.NewAPI(client)
2778+
e = api.DeleteSaml(request)
2779+
if e != nil {
2780+
return nil, e
2781+
}
2782+
2783+
return &core.SuccessResult{
2784+
Resource: "saml",
2785+
Verb: "delete",
2786+
}, nil
2787+
},
2788+
}
2789+
}
2790+
2791+
func iamSamlCertificatesList() *core.Command {
2792+
return &core.Command{
2793+
Short: `List SAML certificates`,
2794+
Long: `List SAML certificates.`,
2795+
Namespace: "iam",
2796+
Resource: "saml-certificates",
2797+
Verb: "list",
2798+
// Deprecated: false,
2799+
ArgsType: reflect.TypeOf(iam.ListSamlCertificatesRequest{}),
2800+
ArgSpecs: core.ArgSpecs{
2801+
{
2802+
Name: "saml-id",
2803+
Short: `ID of the SAML configuration`,
2804+
Required: true,
2805+
Deprecated: false,
2806+
Positional: true,
2807+
},
2808+
},
2809+
Run: func(ctx context.Context, args any) (i any, e error) {
2810+
request := args.(*iam.ListSamlCertificatesRequest)
2811+
2812+
client := core.ExtractClient(ctx)
2813+
api := iam.NewAPI(client)
2814+
2815+
return api.ListSamlCertificates(request)
2816+
},
2817+
}
2818+
}
2819+
2820+
func iamSamlCertificatesAdd() *core.Command {
2821+
return &core.Command{
2822+
Short: `Add a SAML certificate`,
2823+
Long: `Add a SAML certificate.`,
2824+
Namespace: "iam",
2825+
Resource: "saml-certificates",
2826+
Verb: "add",
2827+
// Deprecated: false,
2828+
ArgsType: reflect.TypeOf(iam.AddSamlCertificateRequest{}),
2829+
ArgSpecs: core.ArgSpecs{
2830+
{
2831+
Name: "saml-id",
2832+
Short: `ID of the SAML configuration`,
2833+
Required: true,
2834+
Deprecated: false,
2835+
Positional: true,
2836+
},
2837+
{
2838+
Name: "type",
2839+
Short: `Type of the SAML certificate`,
2840+
Required: true,
2841+
Deprecated: false,
2842+
Positional: false,
2843+
EnumValues: []string{
2844+
"unknown_certificate_type",
2845+
"signing",
2846+
"encryption",
2847+
},
2848+
},
2849+
{
2850+
Name: "content",
2851+
Short: `Content of the SAML certificate`,
2852+
Required: true,
2853+
Deprecated: false,
2854+
Positional: false,
2855+
},
2856+
},
2857+
Run: func(ctx context.Context, args any) (i any, e error) {
2858+
request := args.(*iam.AddSamlCertificateRequest)
2859+
2860+
client := core.ExtractClient(ctx)
2861+
api := iam.NewAPI(client)
2862+
2863+
return api.AddSamlCertificate(request)
2864+
},
2865+
}
2866+
}
2867+
2868+
func iamSamlCertificatesDelete() *core.Command {
2869+
return &core.Command{
2870+
Short: `Delete a SAML certificate`,
2871+
Long: `Delete a SAML certificate.`,
2872+
Namespace: "iam",
2873+
Resource: "saml-certificates",
2874+
Verb: "delete",
2875+
// Deprecated: false,
2876+
ArgsType: reflect.TypeOf(iam.DeleteSamlCertificateRequest{}),
2877+
ArgSpecs: core.ArgSpecs{
2878+
{
2879+
Name: "certificate-id",
2880+
Short: `ID of the certificate to delete`,
2881+
Required: true,
2882+
Deprecated: false,
2883+
Positional: true,
2884+
},
2885+
},
2886+
Run: func(ctx context.Context, args any) (i any, e error) {
2887+
request := args.(*iam.DeleteSamlCertificateRequest)
2888+
2889+
client := core.ExtractClient(ctx)
2890+
api := iam.NewAPI(client)
2891+
e = api.DeleteSamlCertificate(request)
2892+
if e != nil {
2893+
return nil, e
2894+
}
2895+
2896+
return &core.SuccessResult{
2897+
Resource: "saml-certificates",
2898+
Verb: "delete",
2899+
}, nil
2900+
},
2901+
}
2902+
}

0 commit comments

Comments
 (0)