diff --git a/CHANGELOG.md b/CHANGELOG.md index d318454..1c27b07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [1.1.5](https://github.com/JanssenProject/terraform-provider-jans/compare/v1.1.2...v1.1.5) (2024-09-11) + + +### Bug Fixes + +* documentation +* update API and sync with jans updates + ## [1.1.2](https://github.com/JanssenProject/terraform-provider-jans/compare/v1.1.0...v1.1.2) (2024-05-29) diff --git a/README.md b/README.md index 083538f..f9cfe17 100644 --- a/README.md +++ b/README.md @@ -42,5 +42,12 @@ If any of those 3 parameters is not provided, the provider will not be able to c Optionally, users can also set the following variables: * `insecure_client` - If set to `true`, the provider will not verify the TLS certificate of the Janssen server. This is useful for testing purposes and should not be used in production, unless absolutely unavoidable. - +## Tests + +Before you run the tests, the custom_attribute test requires that a custom column is present in the user table, to be added as the custom attribute. Add `tbutlonger` VARCHAR field by following the [guide](https://docs.jans.io/stable/admin/reference/database/mysql-ops/#add-custom-attribute) provided in the Janssen documentation. + +You can run the tests by running `make test`. + +The tests require some environment variables to run, which are automatically set when running them through the Makefile. +When debugging the tests, without using the Makefile, make sure to have the environment variables present. They can be found in the Makefile. diff --git a/docs/resources/api_app_configuration.md b/docs/resources/api_app_configuration.md index f2f4307..656db13 100644 --- a/docs/resources/api_app_configuration.md +++ b/docs/resources/api_app_configuration.md @@ -28,6 +28,7 @@ resource "jans_api_app_configuration" "global" { - `api_client_id` (String) - `api_client_password` (String) - `api_protection_type` (String) +- `acr_validation_enabled` (Boolean) - `asset_mgt_configuration` (Block List) (see [below for nested schema](#nestedblock--asset_mgt_configuration)) - `audit_log_conf` (Block List) (see [below for nested schema](#nestedblock--audit_log_conf)) - `auth_issuer_url` (String) @@ -37,6 +38,7 @@ resource "jans_api_app_configuration" "global" { - `auth_openid_token_url` (String) - `config_oauth_enabled` (Boolean) - `cors_configuration_filters` (Block List) (see [below for nested schema](#nestedblock--cors_configuration_filters)) +- `custom_attribute_validation_enabled` (Boolean) - `data_format_conversion_conf` (Block List) (see [below for nested schema](#nestedblock--data_format_conversion_conf)) - `disable_audit_logger` (Boolean) - `disable_jdk_logger` (Boolean) @@ -48,7 +50,6 @@ resource "jans_api_app_configuration" "global" { - `logging_level` (String) - `max_count` (Number) - `plugins` (Block List) (see [below for nested schema](#nestedblock--plugins)) -- `smallrye_health_root_path` (String) - `user_exclusion_attributes` (List of String) - `user_mandatory_attributes` (List of String) @@ -74,6 +75,9 @@ Optional: - `asset_dir_mappings` (Block List) (see [below for nested schema](#nestedblock--asset_mgt_configuration--asset_dir_mappings)) - `asset_mgt_enabled` (Boolean) - `asset_server_upload_enabled` (Boolean) +- `file_extension_validation_enabled` (Boolean) +- `jans_service_module` (List of String) +- `module_name_validation_enabled` (Boolean) ### Nested Schema for `asset_mgt_configuration.asset_dir_mappings` diff --git a/docs/resources/app_configuration.md b/docs/resources/app_configuration.md index 0a71339..ad462b8 100644 --- a/docs/resources/app_configuration.md +++ b/docs/resources/app_configuration.md @@ -309,6 +309,10 @@ resource "jans_app_configuration" "global" { - `stat_timer_interval_in_seconds` (Number) Statistical data capture time interval. - `static_decryption_kid` (String) Specifies static decryption Kid - `static_kid` (String) Specifies static Kid +- `status_list_bit_size` (Number) The size of status list bit. +- `status_list_index_allocation_block_size` (Number) The size of status list index allocation block. +- `status_list_response_jwt_lifetime` (Number) The lifetime of status list response JWT. +- `status_list_response_jwt_signature_algorithm` (String) The signature algorithm for status list response JWT. - `subject_identifiers_per_client_supported` (List of String) A list of the subject identifiers supported per client. - `subject_types_supported` (List of String) A list of the Subject Identifier types that this OP supports. Valid types include pairwise and public. - `token_endpoint` (String) The token endpoint URL. Example: https://server.example.com/restv1/token diff --git a/docs/resources/custom_user.md b/docs/resources/custom_user.md index 2c573c5..b303ffa 100644 --- a/docs/resources/custom_user.md +++ b/docs/resources/custom_user.md @@ -56,6 +56,7 @@ resource "jans_custom_user" "test" { - `custom_object_classes` (List of String) - `external_uid` (List of String) External UID. - `ox_auth_persistent_jwt` (List of String) Persistent JWT. +- `status` (String) User status - `user_password` (String) User password ### Read-Only diff --git a/docs/resources/default_authentication_method.md b/docs/resources/default_authentication_method.md index 962813e..06b8f84 100644 --- a/docs/resources/default_authentication_method.md +++ b/docs/resources/default_authentication_method.md @@ -14,7 +14,7 @@ description: |- ```terraform resource "jans_default_authentication_method" "global" { - default_acr = "pwd" + default_acr = "simple_password_auth" } ``` diff --git a/docs/resources/kc_saml_configuration.md b/docs/resources/kc_saml_configuration.md index 5d97448..f6fe1c2 100644 --- a/docs/resources/kc_saml_configuration.md +++ b/docs/resources/kc_saml_configuration.md @@ -31,7 +31,7 @@ Resource for managing Keycloak SAML Configuration. - `idp_metadata_temp_dir` (String) IDP Metadata Temporary Directory. - `idp_root_dir` (String) IDP Root Directory. - `idp_url` (String) IDP URL. -- `ignore_validation` (String) Ignore Validation. +- `ignore_validation` (Boolean) Ignore Validation. - `kc_attributes` (List of String) KC Attributes. - `kc_saml_config` (List of String) KC SAML Config.. - `password` (String) Password. @@ -39,6 +39,7 @@ Resource for managing Keycloak SAML Configuration. - `saml_trust_relationship_dn` (String) SAML trust relationship DN. - `scope` (String) Scope. - `server_url` (String) Server URL. +- `set_config_default_value` (Boolean) Set Config Default Value. - `slected_idp` (String) Selected IDP. - `sp_metadata_dir` (String) SP Metadata Directory. - `sp_metadata_file` (String) SP Metadata File. diff --git a/docs/resources/kc_saml_identity_provider.md b/docs/resources/kc_saml_identity_provider.md index 8357489..6334d11 100644 --- a/docs/resources/kc_saml_identity_provider.md +++ b/docs/resources/kc_saml_identity_provider.md @@ -39,6 +39,8 @@ Resource for managing Keycloak SAML Identity Provider. - `metadata_file` (String) Metadata file location for the trust relationship. - `name_id_policy_format` (String) Name ID policy format of the identity provider. - `post_broker_login_flow_alias` (String) Post broker login flow alias of the identity provider. +- `principal_attribute` (String) Principal attribute of the identity provider. +- `principal_type` (String) Principal type of the identity provider. - `provider_id` (String) Provider ID of the identity provider. - `signing_certificate` (String) Signing certificate of the identity provider. - `single_logout_service_url` (String) Single logout service URL of the identity provider. diff --git a/docs/resources/kc_saml_trust_relationship.md b/docs/resources/kc_saml_trust_relationship.md index bbf392c..3599067 100644 --- a/docs/resources/kc_saml_trust_relationship.md +++ b/docs/resources/kc_saml_trust_relationship.md @@ -22,10 +22,8 @@ Resource for managing Keycloak SAML Trust Relationship. ### Optional -- `admin_url` (String) Admin URL of the trust relationship. - `always_display_in_console` (Boolean) Always display in console of the trust relationship. - `base_dn` (String) Base DN of the trust relationship. -- `base_url` (String) Base URL of the trust relationship. - `client_authenticator_type` (String) Client authenticator type of the trust relationship. - `consent_required` (Boolean) Consent required of the trust relationship. - `enabled` (Boolean) Status of the trust relationship. @@ -43,8 +41,6 @@ Resource for managing Keycloak SAML Trust Relationship. - `sp_logout_url` (String) SP logout URL of the trust relationship. - `sp_meta_data_url` (String) SP metadata URL of the trust relationship. - `status` (String) Status of the trust relationship. -- `surrogate_auth_required` (Boolean) Surrogate auth required of the trust relationship. -- `url` (String) URL of the trust relationship. - `validation_log` (List of String) Validation log of the trust relationship. - `validation_status` (String) Validation status of the trust relationship. diff --git a/docs/resources/scim_app_configuration.md b/docs/resources/scim_app_configuration.md index a6e4d3c..c6285d0 100644 --- a/docs/resources/scim_app_configuration.md +++ b/docs/resources/scim_app_configuration.md @@ -43,7 +43,9 @@ resource "jans_scim_app_configuration" "global" { - `base_endpoint` (String) SCIM base endpoint URL - `bulk_max_operations` (Number) Specifies maximum bulk operations. - `bulk_max_payload_size` (Number) Specifies maximum payload size of bulk operations. +- `disable_audit_logger` (Boolean) - `disable_jdk_logger` (Boolean) Boolean value specifying whether to enable JDK Loggers. +- `disable_logger_timer` (Boolean) - `external_logger_configuration` (String) Path to external log4j2 logging configuration. - `logging_layout` (String) Logging layout used for Server loggers. - `logging_level` (String) Logging level for scim logger. diff --git a/examples/resources/jans_default_authentication_method/resource.tf b/examples/resources/jans_default_authentication_method/resource.tf index 81543dc..9215cca 100644 --- a/examples/resources/jans_default_authentication_method/resource.tf +++ b/examples/resources/jans_default_authentication_method/resource.tf @@ -1,3 +1,3 @@ resource "jans_default_authentication_method" "global" { - default_acr = "pwd" -} \ No newline at end of file + default_acr = "simple_password_auth" +} diff --git a/examples/resources/jans_smtp_configuration/resource.tf b/examples/resources/jans_smtp_configuration/resource.tf index da8f89d..ce7863e 100644 --- a/examples/resources/jans_smtp_configuration/resource.tf +++ b/examples/resources/jans_smtp_configuration/resource.tf @@ -1,17 +1,17 @@ resource "jans_smtp_configuration" "global" { - host = "smtp.janssen.io" - port = 587 - requires_ssl = true - trust_host = true - from_name = "Janssen" - from_email_address = "jans@janssen.io" - requires_authentication = true - user_name = "janssen" - password = "password" + host = "smtp.janssen.io" + port = 587 + requires_ssl = true + trust_host = true + from_name = "Janssen" + from_email_address = "jans@janssen.io" + requires_authentication = true + smtp_authentication_account_username = "janssen" + smtp_authentication_account_password = "password" lifecycle { # ignore changes to password, as it will be returned as a hash # from the API ignore_changes = [ password ] } -} \ No newline at end of file +} diff --git a/go.mod b/go.mod index 8a95621..aea7e0b 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/hashicorp/terraform-json v0.17.1 // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - golang.org/x/crypto v0.17.0 // indirect + golang.org/x/crypto v0.21.0 // indirect golang.org/x/mod v0.13.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect ) @@ -49,10 +49,10 @@ require ( github.com/oklog/run v1.0.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/zclconf/go-cty v1.14.1 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/grpc v1.57.1 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect ) diff --git a/go.sum b/go.sum index 124f45c..38f22a5 100644 --- a/go.sum +++ b/go.sum @@ -127,8 +127,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= @@ -141,8 +141,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -161,8 +161,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -193,8 +193,8 @@ google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg= google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/jans/agama_deployment_test.go b/jans/agama_deployment_test.go index a20e501..2868e92 100644 --- a/jans/agama_deployment_test.go +++ b/jans/agama_deployment_test.go @@ -23,8 +23,8 @@ func TestAgamaDeployment(t *testing.T) { t.Error(err) } - if len(deployments) != 0 { - t.Errorf("expected 0 deployments, got %d", len(deployments)) + if len(deployments) != 1 { + t.Errorf("expected 1 deployments, got %d", len(deployments)) } _ = client.DeleteAgamaDeployment(ctx, "test-deployment") @@ -70,8 +70,8 @@ func TestAgamaDeployment(t *testing.T) { t.Error(err) } - if len(deployments) != 1 { - t.Errorf("expected 1 deployment, got %d", len(deployments)) + if len(deployments) != 2 { + t.Errorf("expected 2 deployment, got %d", len(deployments)) } // delete test deployment diff --git a/jans/api_app_configuration.go b/jans/api_app_configuration.go index 12ad724..fcb3dc2 100644 --- a/jans/api_app_configuration.go +++ b/jans/api_app_configuration.go @@ -28,43 +28,47 @@ type AssetDirMapping struct { } type AssetMgtConfiguration struct { - AssetMgtEnabled bool `schema:"asset_mgt_enabled" json:"assetMgtEnabled"` - AssetServerUploadEnabled bool `schema:"asset_server_upload_enabled" json:"assetServerUploadEnabled"` - AssetBaseDirectory string `schema:"asset_base_directory" json:"assetBaseDirectory"` - AssetDirMappings []AssetDirMapping `schema:"asset_dir_mappings" json:"assetDirMappings"` + AssetMgtEnabled bool `schema:"asset_mgt_enabled" json:"assetMgtEnabled"` + AssetServerUploadEnabled bool `schema:"asset_server_upload_enabled" json:"assetServerUploadEnabled"` + FileExtensionValidationEnabled bool `schema:"file_extension_validation_enabled" json:"fileExtensionValidationEnabled"` + ModuleNameValidationEnabled bool `schema:"module_name_validation_enabled" json:"moduleNameValidationEnabled"` + AssetBaseDirectory string `schema:"asset_base_directory" json:"assetBaseDirectory"` + JansServiceModule []string `schema:"jans_service_module" json:"jansServiceModule"` + AssetDirMappings []AssetDirMapping `schema:"asset_dir_mappings" json:"assetDirMapping"` } // PersistenceConfiguration represents the persistence configuration // of the Janssen server. type ApiAppConfiguration struct { - ConfigOauthEnabled bool `schema:"config_oauth_enabled" json:"configOauthEnabled"` - DisableLoggerTimer bool `schema:"disable_logger_timer" json:"disableLoggerTimer"` - DisableAuditLogger bool `schema:"disable_audit_logger" json:"disableAuditLogger"` - ApiApprovedIssuer []string `schema:"api_approved_issuer" json:"apiApprovedIssuer"` - ApiProtectionType string `schema:"api_protection_type" json:"apiProtectionType"` - ApiClientId string `schema:"api_client_id" json:"apiClientId"` - ApiClientPassword string `schema:"api_client_password" json:"apiClientPassword"` - EndpointInjectionEnabled bool `schema:"endpoint_injection_enabled" json:"endpointInjectionEnabled"` - AuthIssuerUrl string `schema:"auth_issuer_url" json:"authIssuerUrl"` - AuthOpenidConfigurationUrl string `schema:"auth_openid_configuration_url" json:"authOpenidConfigurationUrl"` - AuthOpenidIntrospectionUrl string `schema:"auth_openid_introspection_url" json:"authOpenidIntrospectionUrl"` - AuthOpenidTokenUrl string `schema:"auth_openid_token_url" json:"authOpenidTokenUrl"` - AuthOpenidRevokeUrl string `schema:"auth_openid_revoke_url" json:"authOpenidRevokeUrl"` - SmallryeHealthRootPath string `schema:"smallrye_health_root_path" json:"smallryeHealthRootPath"` - ExclusiveAuthScopes []string `schema:"exclusive_auth_scopes" json:"exclusiveAuthScopes"` - CorsConfigurationFilters []CorsConfigurationFilter `schema:"cors_configuration_filters" json:"corsConfigurationFilters"` - LoggingLevel string `schema:"logging_level" json:"loggingLevel"` - LoggingLayout string `schema:"logging_layout" json:"loggingLayout"` - ExternalLoggerConfiguration string `schema:"external_logger_configuration" json:"externalLoggerConfiguration"` - DisableJdkLogger bool `schema:"disable_jdk_logger" json:"disableJdkLogger"` - MaxCount int `schema:"max_count" json:"maxCount"` - UserExclusionAttributes []string `schema:"user_exclusion_attributes" json:"userExclusionAttributes"` - UserMandatoryAttributes []string `schema:"user_mandatory_attributes" json:"userMandatoryAttributes"` - AgamaConfiguration AgamaConfiguration `schema:"agama_configuration" json:"agamaConfiguration"` - AuditLogConf AuditLogConf `schema:"audit_log_conf" json:"auditLogConf"` - DataFormatConversionConf DataFormatConversionConf `schema:"data_format_conversion_conf" json:"dataFormatConversionConf"` - Plugins []PluginConf `schema:"plugins" json:"plugins"` - AssetMgtConfiguration AssetMgtConfiguration `schema:"asset_mgt_configuration" json:"assetMgtConfiguration"` + ConfigOauthEnabled bool `schema:"config_oauth_enabled" json:"configOauthEnabled"` + DisableLoggerTimer bool `schema:"disable_logger_timer" json:"disableLoggerTimer"` + DisableAuditLogger bool `schema:"disable_audit_logger" json:"disableAuditLogger"` + CustomAttributeValidationEnabled bool `schema:"custom_attribute_validation_enabled" json:"customAttributeValidationEnabled"` + ArcValidationEnabled bool `schema:"acr_validation_enabled" json:"acrValidationEnabled"` + ApiApprovedIssuer []string `schema:"api_approved_issuer" json:"apiApprovedIssuer"` + ApiProtectionType string `schema:"api_protection_type" json:"apiProtectionType"` + ApiClientId string `schema:"api_client_id" json:"apiClientId"` + ApiClientPassword string `schema:"api_client_password" json:"apiClientPassword"` + EndpointInjectionEnabled bool `schema:"endpoint_injection_enabled" json:"endpointInjectionEnabled"` + AuthIssuerUrl string `schema:"auth_issuer_url" json:"authIssuerUrl"` + AuthOpenidConfigurationUrl string `schema:"auth_openid_configuration_url" json:"authOpenidConfigurationUrl"` + AuthOpenidIntrospectionUrl string `schema:"auth_openid_introspection_url" json:"authOpenidIntrospectionUrl"` + AuthOpenidTokenUrl string `schema:"auth_openid_token_url" json:"authOpenidTokenUrl"` + AuthOpenidRevokeUrl string `schema:"auth_openid_revoke_url" json:"authOpenidRevokeUrl"` + ExclusiveAuthScopes []string `schema:"exclusive_auth_scopes" json:"exclusiveAuthScopes"` + CorsConfigurationFilters []CorsConfigurationFilter `schema:"cors_configuration_filters" json:"corsConfigurationFilters"` + LoggingLevel string `schema:"logging_level" json:"loggingLevel"` + LoggingLayout string `schema:"logging_layout" json:"loggingLayout"` + ExternalLoggerConfiguration string `schema:"external_logger_configuration" json:"externalLoggerConfiguration"` + DisableJdkLogger bool `schema:"disable_jdk_logger" json:"disableJdkLogger"` + MaxCount int `schema:"max_count" json:"maxCount"` + UserExclusionAttributes []string `schema:"user_exclusion_attributes" json:"userExclusionAttributes"` + UserMandatoryAttributes []string `schema:"user_mandatory_attributes" json:"userMandatoryAttributes"` + AgamaConfiguration AgamaConfiguration `schema:"agama_configuration" json:"agamaConfiguration"` + AuditLogConf AuditLogConf `schema:"audit_log_conf" json:"auditLogConf"` + DataFormatConversionConf DataFormatConversionConf `schema:"data_format_conversion_conf" json:"dataFormatConversionConf"` + Plugins []PluginConf `schema:"plugins" json:"plugins"` + AssetMgtConfiguration AssetMgtConfiguration `schema:"asset_mgt_configuration" json:"assetMgtConfiguration"` } // GetApiAppConfiguration returns the current API configuration. diff --git a/jans/app_configuration.go b/jans/app_configuration.go index c6909b5..cdbd71d 100644 --- a/jans/app_configuration.go +++ b/jans/app_configuration.go @@ -163,6 +163,10 @@ type AppConfiguration struct { StatAuthorizationScope string `schema:"stat_authorization_scope" json:"statAuthorizationScope"` AllowSpontaneousScopes bool `schema:"allow_spontaneous_scopes" json:"allowSpontaneousScopes"` SpontaneousScopeLifetime int `schema:"spontaneous_scope_lifetime" json:"spontaneousScopeLifetime"` + StatusListBitSize int `schema:"status_list_bit_size" json:"statusListBitSize"` + StatusListResponseJwtSignatureAlgorithm string `schema:"status_list_response_jwt_signature_algorithm" json:"statusListResponseJwtSignatureAlgorithm"` + StatusListResponseJwtLifetime int `schema:"status_list_response_jwt_lifetime" json:"statusListResponseJwtLifetime"` + StatusListIndexAllocationBlockSize int `schema:"status_list_index_allocation_block_size" json:"statusListIndexAllocationBlockSize"` OpenIDSubAttribute string `schema:"openid_sub_attribute" json:"openIdSubAttribute"` PublicSubjectIdentifierPerClientEnabled bool `schema:"public_subject_identifier_per_client_enabled" json:"publicSubjectIdentifierPerClientEnabled"` SubjectIdentifiersPerClientSupported []string `schema:"subject_identifiers_per_client_supported" json:"subjectIdentifiersPerClientSupported"` diff --git a/jans/attributes.go b/jans/attributes.go index 5ae0e72..ee41de6 100644 --- a/jans/attributes.go +++ b/jans/attributes.go @@ -39,7 +39,6 @@ type Attribute struct { OxMultiValuedAttribute bool `schema:"ox_multi_valued_attribute" json:"oxMultiValuedAttribute,omitempty"` JansHideOnDiscovery bool `schema:"jans_hide_on_discovery" json:"jansHideOnDiscovery,omitempty"` Custom bool `schema:"custom" json:"custom,omitempty"` - Required bool `schema:"required" json:"requred,omitempty"` AttributeValidation *AttributeValidation `schema:"attribute_validation" json:"attributeValidation,omitempty"` Tooltip string `schema:"tooltip" json:"tooltip,omitempty"` AdminCanAccess bool `schema:"admin_can_access" json:"adminCanAccess,omitempty"` @@ -62,9 +61,9 @@ func (c *Client) GetAttributes(ctx context.Context) ([]Attribute, error) { } type response struct { - Data []Attribute `json:"data"` - Count int `json:"entriesCount"` - TotalItems int `json:"totalItems"` + Entries []Attribute `json:"entries"` + EntriesCount int `json:"entriesCount"` + TotalEntriesCount int `json:"totalEntriesCount"` } resp := response{} @@ -75,7 +74,7 @@ func (c *Client) GetAttributes(ctx context.Context) ([]Attribute, error) { return nil, fmt.Errorf("get request failed: %w", err) } - return resp.Data, nil + return resp.Entries, nil } // GetAttribute returns a single Jans attribute, identified by its inum. diff --git a/jans/attributes_test.go b/jans/attributes_test.go index e1530b3..143b57e 100644 --- a/jans/attributes_test.go +++ b/jans/attributes_test.go @@ -16,11 +16,19 @@ func TestAttributes(t *testing.T) { ctx := context.Background() - _, err = client.GetAttributes(ctx) + attrs, err := client.GetAttributes(ctx) if err != nil { t.Fatal(err) } + for _, attr := range attrs { + if attr.Name == "l" { + if err = client.DeleteAttribute(ctx, attr.Inum); err != nil { + t.Fatal(err) + } + } + } + newAttribute := &Attribute{ AdminCanAccess: true, AdminCanView: true, @@ -31,7 +39,7 @@ func TestAttributes(t *testing.T) { DisplayName: "test", EditType: []string{"user", "admin"}, Inum: "7AC6", - Name: "t", + Name: "tbutlonger", Origin: "jansCustomPerson", Saml1Uri: "urn:mace:dir:attribute-def:t", Saml2Uri: "urn:oid:2.5.4.7", diff --git a/jans/client.go b/jans/client.go index eb94b90..6925b08 100644 --- a/jans/client.go +++ b/jans/client.go @@ -12,6 +12,7 @@ import ( "sort" "net/http" + "net/http/httputil" "net/textproto" "net/url" ) @@ -95,11 +96,20 @@ func (c *Client) getToken(ctx context.Context, scope string) (string, error) { tr.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} } client := &http.Client{Transport: tr} + + // b, _ := httputil.DumpRequest(req, true) + // tflog.Info(ctx, "Request", map[string]any{"req": string(b)}) + // fmt.Printf("Request:\n%s\n", string(b)) + resp, err := client.Do(req) if err != nil { return "", fmt.Errorf("could not perform request: %w", err) } + // b, _ = httputil.DumpResponse(resp, true) + // tflog.Info(ctx, "Response", map[string]any{"resp": string(b)}) + // fmt.Printf("Response:\n%s\n", string(b)) + data, err := io.ReadAll(resp.Body) if err != nil { return "", fmt.Errorf("could not read response body: %w", err) @@ -469,18 +479,18 @@ func (c *Client) request(ctx context.Context, params requestParams) error { } client := &http.Client{Transport: tr} - // b, _ := httputil.DumpRequest(req, true) + b, _ := httputil.DumpRequest(req, true) // tflog.Info(ctx, "Request", map[string]any{"req": string(b)}) - // fmt.Printf("Request:\n%s\n", string(b)) + fmt.Printf("Request:\n%s\n", string(b)) resp, err := client.Do(req) if err != nil { return fmt.Errorf("could not perform request: %w", err) } - // b, _ = httputil.DumpResponse(resp, true) + b, _ = httputil.DumpResponse(resp, true) // tflog.Info(ctx, "Response", map[string]any{"resp": string(b)}) - // fmt.Printf("Response:\n%s\n", string(b)) + fmt.Printf("Response:\n%s\n", string(b)) if resp.StatusCode == 400 { // try to read error message diff --git a/jans/client_test.go b/jans/client_test.go index eebf664..f2dbda0 100644 --- a/jans/client_test.go +++ b/jans/client_test.go @@ -11,7 +11,7 @@ var ( host = "" user = "" pass = "" - skipKnownFailures = false + skipKnownFailures = true ) func TestMain(m *testing.M) { diff --git a/jans/custom_user.go b/jans/custom_user.go index 9f2ccb7..c94f218 100644 --- a/jans/custom_user.go +++ b/jans/custom_user.go @@ -18,14 +18,13 @@ type UserAuthenticatorList struct { type CustomUser struct { Dn string `schema:"dn" json:"dn,omitempty"` BaseDn string `schema:"base_dn" json:"baseDn,omitempty"` - JansStatus string `schema:"jans_status" json:"jansStatus,omitempty"` UserID string `schema:"user_id" json:"userId,omitempty"` CreatedAt string `schema:"created_at" json:"createdAt,omitempty"` UpdatedAt string `schema:"updated_at" json:"updatedAt,omitempty"` OxAuthPersistentJwt []string `schema:"ox_auth_persistent_jwt" json:"oxAuthPersistentJwt,omitempty"` ExternalUid []string `schema:"external_uid" json:"externalUid,omitempty"` Authenticator UserAuthenticatorList `schema:"authenticator" json:"authenticator,omitempty"` - Status string `schema:"status" json:"status,omitempty"` + Status string `schema:"jans_status" json:"status,omitempty"` CustomAttributes []CustomAttribute `schema:"custom_attributes" json:"customAttributes,omitempty"` CustomObjectClasses []string `schema:"custom_object_classes" json:"customObjectClasses,omitempty"` Mail string `schema:"mail" json:"mail,omitempty"` diff --git a/jans/custom_user_test.go b/jans/custom_user_test.go index 7d8ca86..66924e4 100644 --- a/jans/custom_user_test.go +++ b/jans/custom_user_test.go @@ -16,11 +16,20 @@ func TestCustomUsers(t *testing.T) { ctx := context.Background() - _, err = client.GetCustomUsers(ctx) + users, err := client.GetCustomUsers(ctx) if err != nil { t.Error(err) } + for _, user := range users { + if user.UserID == "test" { + err = client.DeleteCustomUser(ctx, user.Inum) + if err != nil { + t.Fatal(err) + } + } + } + usr := CustomUser{ UserID: "exampleUsr1", CustomAttributes: []CustomAttribute{ @@ -77,7 +86,7 @@ func TestCustomUsers(t *testing.T) { Mail: "exampleUsr1@jans.io", OxAuthPersistentJwt: []string{"jwt1", "jwt2"}, DisplayName: "Default Test User", - JansStatus: "active", + Status: "active", UserPassword: "pwd123", GivenName: "exampleUsr1", } diff --git a/jans/default_authentication_method_test.go b/jans/default_authentication_method_test.go index fd13ac7..12c4cbb 100644 --- a/jans/default_authentication_method_test.go +++ b/jans/default_authentication_method_test.go @@ -19,25 +19,14 @@ func TestAuthenticationMethod(t *testing.T) { t.Fatal(err) } - am.DefaultAcr = "pwd" + am.DefaultAcr = "simple_password_auth" updatedAM, err := client.UpdateDefaultAuthenticationMethod(ctx, am) if err != nil { t.Fatal(err) } - if updatedAM.DefaultAcr != "pwd" { - t.Fatal("DefaultAcr is not updated") - } - - updatedAM, err = client.UpdateDefaultAuthenticationMethod(ctx, &DefaultAuthenticationMethod{ - DefaultAcr: "token", - }) - if err != nil { - t.Fatal(err) - } - - if updatedAM.DefaultAcr != "token" { + if updatedAM.DefaultAcr != "simple_password_auth" { t.Fatal("DefaultAcr is not updated") } } diff --git a/jans/jans_asset_test.go b/jans/jans_asset_test.go index ff25bd4..c01307c 100644 --- a/jans/jans_asset_test.go +++ b/jans/jans_asset_test.go @@ -13,6 +13,7 @@ import ( var testFile embed.FS func TestCreateJansAsset(t *testing.T) { + t.Skip("Service not implemented") c, err := NewInsecureClient(host, user, pass) if err != nil { t.Fatal(err) diff --git a/jans/kc_saml_config.go b/jans/kc_saml_config.go index 3708e07..db60af9 100644 --- a/jans/kc_saml_config.go +++ b/jans/kc_saml_config.go @@ -33,6 +33,7 @@ type KCSAMLConfiguration struct { SpMetadataTempDir string `schema:"sp_metadata_temp_dir" json:"spMetadataTempDir"` SpMetadataFile string `schema:"sp_metadata_file" json:"spMetadataFile"` IgnoreValidation bool `schema:"ignore_validation" json:"ignoreValidation"` + SetConfigDefaultValue bool `schema:"set_config_default_value" json:"setConfigDefaultValue"` IdpMetadataMandatoryAttributes []string `schema:"idp_metadata_mandatory_attributes" json:"idpMetadataMandatoryAttributes"` KcAttributes []string `schema:"kc_attributes" json:"kcAttributes"` KcSamlConfig []string `schema:"kc_saml_config" json:"kcSamlConfig"` diff --git a/jans/kc_saml_config_test.go b/jans/kc_saml_config_test.go index 5f5a4d7..dc59ed3 100644 --- a/jans/kc_saml_config_test.go +++ b/jans/kc_saml_config_test.go @@ -16,8 +16,9 @@ func TestCreateConfig(t *testing.T) { ctx := context.Background() config := &KCSAMLConfiguration{ - ApplicationName: "SomeAPP", - Enabled: true, + ApplicationName: "SomeAPP", + Enabled: true, + IdpMetadataMandatoryAttributes: []string{"name"}, } _, err = c.CreateKCSAMLConfiguration(ctx, config) diff --git a/jans/kc_saml_idp.go b/jans/kc_saml_idp.go index 4c65059..a8448bd 100644 --- a/jans/kc_saml_idp.go +++ b/jans/kc_saml_idp.go @@ -33,6 +33,8 @@ type IdentityProvider struct { ValidateSignature string `schema:"validate_signature" json:"validateSignature"` SingleLogoutServiceUrl string `schema:"single_logout_service_url" json:"singleLogoutServiceUrl"` NameIDPolicyFormat string `schema:"name_id_policy_format" json:"nameIDPolicyFormat"` + PrincipalAttribute string `schema:"principal_attribute" json:"principalAttribute"` + PrincipalType string `schema:"principal_type" json:"principalType"` IdpEntityId string `schema:"idp_entity_id" json:"idpEntityId"` SingleSignOnServiceUrl string `schema:"single_sign_on_service_url" json:"singleSignOnServiceUrl"` EncryptionPublicKey string `schema:"encryption_public_key" json:"encryptionPublicKey"` @@ -145,7 +147,7 @@ func (c *Client) GetIDP(ctx context.Context, inum string) (*IdentityProvider, er func (c *Client) DeleteIDP(ctx context.Context, inum string) error { - token, err := c.getToken(ctx, "https://jans.io/idp/saml.write") + token, err := c.getToken(ctx, "https://jans.io/idp/saml.delete") if err != nil { return fmt.Errorf("failed to get token: %w", err) } diff --git a/jans/kc_saml_idp_test.go b/jans/kc_saml_idp_test.go index 8c37374..e45b327 100644 --- a/jans/kc_saml_idp_test.go +++ b/jans/kc_saml_idp_test.go @@ -2,6 +2,7 @@ package jans import ( "context" + "os" "testing" "github.com/google/go-cmp/cmp" @@ -26,7 +27,12 @@ func TestCreateIDP(t *testing.T) { SingleSignOnServiceUrl: "https://moabu-promoted-loon.gluu.info/idp/profile/SAML2/POST/SSO", } - idp, err = c.CreateIDP(ctx, idp, nil) + file, err := os.Open("testdata/metadata.xml") + if err != nil { + t.Fatalf("could not open metadata file: %v", err) + } + + idp, err = c.CreateIDP(ctx, idp, file) if err != nil { t.Fatal(err) } @@ -38,7 +44,11 @@ func TestCreateIDP(t *testing.T) { idp.Description = "Updated description" - idp, err = c.UpdateIDP(ctx, idp, nil) + if _, err = file.Seek(0, 0); err != nil { + t.Fatalf("could not seek to beginning of file: %v", err) + } + + idp, err = c.UpdateIDP(ctx, idp, file) if err != nil { t.Fatal(err) } diff --git a/jans/kc_saml_tr.go b/jans/kc_saml_tr.go index e01e49c..aaa562c 100644 --- a/jans/kc_saml_tr.go +++ b/jans/kc_saml_tr.go @@ -21,9 +21,6 @@ type TrustRelationship struct { DisplayName string `schema:"display_name" json:"displayName"` Description string `schema:"description" json:"description"` RootUrl string `schema:"root_url" json:"rootUrl"` - AdminUrl string `schema:"admin_url" json:"adminUrl"` - BaseUrl string `schema:"base_url" json:"baseUrl"` - SurrogateAuthRequired bool `schema:"surrogate_auth_required" json:"surrogateAuthRequired"` Enabled bool `schema:"enabled" json:"enabled"` AlwaysDisplayInConsole bool `schema:"always_display_in_console" json:"alwaysDisplayInConsole"` ClientAuthenticatorType string `schema:"client_authenticator_type" json:"clientAuthenticatorType"` @@ -36,7 +33,6 @@ type TrustRelationship struct { SPMetaDataURL string `schema:"sp_meta_data_url" json:"spMetaDataURL"` MetaLocation string `schema:"meta_location" json:"metaLocation"` ReleasedAttributes []string `schema:"released_attributes" json:"releasedAttributes"` - Url string `schema:"url" json:"url"` SPLogoutURL string `schema:"sp_logout_url" json:"spLogoutURL"` Status string `schema:"status" json:"status"` ValidationStatus string `schema:"validation_status" json:"validationStatus"` @@ -69,7 +65,7 @@ func (c *Client) createTRFormData(tr *TrustRelationship, file io.Reader) (map[st tr.SPMetaDataSourceType = "manual" if file != nil { - data["metaDataFile"] = FormField{ + data["assetFile"] = FormField{ Typ: "file", Data: file, } @@ -150,6 +146,20 @@ func (c *Client) DeleteTR(ctx context.Context, inum string) error { return nil } +func (c *Client) GetTRs(ctx context.Context) ([]TrustRelationship, error) { + token, err := c.getToken(ctx, "https://jans.io/oauth/config/saml.readonly") + if err != nil { + return nil, fmt.Errorf("failed to get token: %w", err) + } + + resp := []TrustRelationship{} + if err = c.get(ctx, "/jans-config-api/kc/saml/trust-relationship", token, &resp); err != nil { + return nil, fmt.Errorf("get request failed: %w", err) + } + + return resp, nil +} + func (c *Client) GetTR(ctx context.Context, inum string) (*TrustRelationship, error) { token, err := c.getToken(ctx, "https://jans.io/oauth/config/saml.readonly") diff --git a/jans/kc_saml_tr_test.go b/jans/kc_saml_tr_test.go index f68f560..929fa11 100644 --- a/jans/kc_saml_tr_test.go +++ b/jans/kc_saml_tr_test.go @@ -12,6 +12,27 @@ import ( //go:embed testdata/metadata.xml var metadata []byte +func TestQueryTRs(t *testing.T) { + c, err := NewInsecureClient(host, user, pass) + if err != nil { + t.Fatal(err) + } + + ctx := context.Background() + + if trs, err := c.GetTRs(ctx); err != nil { + t.Fatalf("could not get trs: %v", err) + } else { + for _, tr := range trs { + if tr.Name == "My TR7" { + if err = c.DeleteTR(ctx, tr.Inum); err != nil { + t.Fatalf("could not delete tr: %v", err) + } + } + } + } +} + func TestCreateTR(t *testing.T) { c, err := NewInsecureClient(host, user, pass) if err != nil { diff --git a/jans/plugins_test.go b/jans/plugins_test.go index bc048b2..1d5d87f 100644 --- a/jans/plugins_test.go +++ b/jans/plugins_test.go @@ -19,7 +19,7 @@ func TestPlugins(t *testing.T) { t.Fatal(err) } - if len(plugins) != 5 { - t.Fatal("expected 5 plugins, got ", len(plugins)) + if len(plugins) != 7 { + t.Fatal("expected 7 plugins, got ", len(plugins)) } } diff --git a/jans/scim_app_configuration.go b/jans/scim_app_configuration.go index 6b8fddf..0966349 100644 --- a/jans/scim_app_configuration.go +++ b/jans/scim_app_configuration.go @@ -8,6 +8,8 @@ import ( // ScimAppConfigurations is the definition of the SCIM app configuration. type ScimAppConfigurations struct { BaseDN string `schema:"base_dn" json:"baseDN"` + DisableLoggerTimer bool `schema:"disable_logger_timer" json:"disableLoggerTimer"` + DisableAuditLogger bool `schema:"disable_audit_logger" json:"disableAuditLogger"` ApplicationUrl string `schema:"application_url" json:"applicationUrl"` BaseEndpoint string `schema:"base_endpoint" json:"baseEndpoint"` PersonCustomObjectClass string `schema:"person_custom_object_class" json:"personCustomObjectClass"` diff --git a/jans/testdata/metadata.xml b/jans/testdata/metadata.xml index fab84ed..0eef80c 100644 --- a/jans/testdata/metadata.xml +++ b/jans/testdata/metadata.xml @@ -1,8 +1,62 @@ - - - urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress - - - + + + +moabu-star-cricket.gluu.info + + + + + MIIDpzCCAo8CFEJ8QVFd7aejj6RdC9XqybNbp2eBMA0GCSqGSIb3DQEBCwUAMIGP MQswCQYDVQQGEwJJTjELMAkGA1UECAwCTUgxDzANBgNVBAcMBm11bWJhaTEaMBgG A1UECgwRR2x1dSBJRFAgU2VydmVyIDIxKDAmBgNVBAMMH3B1amF2cy1jcmFjay1m bG91bmRlci5nbHV1LmluZm8xHDAaBgkqhkiG9w0BCQEWDXB1amFAZ2x1dS5vcmcw HhcNMjMxMDEyMTU0NTQzWhcNMjQxMDExMTU0NTQzWjCBjzELMAkGA1UEBhMCSU4x CzAJBgNVBAgMAk1IMQ8wDQYDVQQHDAZtdW1iYWkxGjAYBgNVBAoMEUdsdXUgSURQ IFNlcnZlciAyMSgwJgYDVQQDDB9wdWphdnMtY3JhY2stZmxvdW5kZXIuZ2x1dS5p bmZvMRwwGgYJKoZIhvcNAQkBFg1wdWphQGdsdXUub3JnMIIBIjANBgkqhkiG9w0B AQEFAAOCAQ8AMIIBCgKCAQEAoXB81Zlr2ZB1jnplGZ+w3ivhXqLLh+CQWv6DwmtL I2UVHiRZUeSUgWt50JCE4lALt3I1cTqi/uDqtB+nn9/HfxOa73KsJ6/7bY8nWsT+ j1na25H3XnPS4l6c9/WNQAw7VtAHnUvriyzSxD6Ph4Cyodu76yAVxVetgtBEwA/5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kiG9w0B AQEFAAOCAQ8AMIIBCgKCAQEAsCBv4UBQPkXvnwc9IaZHMpn79Dqh6wyGesTPslsQ EbRp3L4aX5xxu/0BKeH4MJhna9rg4ikEP9KPZ7bjXuALXjqqwADnDKYp+EbI/hC5 K2X4wcFb2BGfSlUb4OdzeozSF6MJWC7nfB0o6FTgMlpHRM4A/UymxF8koqy19ESj c1GK+rD7steLhIVQ8tzO80rgkGWlixKf1FoTZw5Rhcpl0h0b15AUVGcFWSx1On1F VLZEeYrLI5vMt2QMHVhO+OfB7cioS2IGYIWeO2IW8ePTwAw/bD/ZzQP6rPYyKYAh newGXcdIjewafrXvwKiX3hUF26SJSupX6xY+W68gahi7YwIDAQABMA0GCSqGSIb3 DQEBCwUAA4IBAQB5PnQeGcMsnGkEOtETvdIKm67C2a2+OWoHyVhZtlYvHSlbFIx6 FAt3/ufX8vJ5N0+D4ReQw5tT3VdDhWhvhrshG50HKR1bF1NIW152v/0B1BxjyhQo p0M6Z2uaCOP7zUd3ZLEIsNH3tqbFV1d+DVLfZDBCUAIOTTySkHWnBjVXlQ2ss63O +SBYBA0U61nxBggzt7UiXBJLyB5+CFafTD4tcGkHjIKLk1CrDPj/4d8d+9EETm0g bVa4bIL1Qb1mUcxQ75xdeuSSp+0u/nk/QBpasFH4uQQWQ0KNviSREl3ShqerybPM EoU3+f42DbxGNwTmEPULvuQAK1k0sxcHuB5I + + + + + + + + +urn:mace:shibboleth:1.0:nameIdentifier +urn:oasis:names:tc:SAML:2.0:nameid-format:transient +urn:oasis:names:tc:SAML:2.0:nameid-format:persistent + + + + + + + +moabu-star-cricket.gluu.info + + + + + MIIDpzCCAo8CFEJ8QVFd7aejj6RdC9XqybNbp2eBMA0GCSqGSIb3DQEBCwUAMIGP MQswCQYDVQQGEwJJTjELMAkGA1UECAwCTUgxDzANBgNVBAcMBm11bWJhaTEaMBgG A1UECgwRR2x1dSBJRFAgU2VydmVyIDIxKDAmBgNVBAMMH3B1amF2cy1jcmFjay1m bG91bm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1d+DVLfZDBCUAIOTTySkHWnBjVXlQ2ss63O +SBYBA0U61nxBggzt7UiXBJLyB5+CFafTD4tcGkHjIKLk1CrDPj/4d8d+9EETm0g bVa4bIL1Qb1mUcxQ75xdeuSSp+0u/nk/QBpasFH4uQQWQ0KNviSREl3ShqerybPM EoU3+f42DbxGNwTmEPULvuQAK1k0sxcHuB5I + + + + + +urn:mace:shibboleth:1.0:nameIdentifier +urn:oasis:names:tc:SAML:2.0:nameid-format:transient +urn:oasis:names:tc:SAML:2.0:nameid-format:persistent + + +Gluu IDP Server 2 +Gluu IDP Server 2 +https://moabu-star-cricket.gluu.info + diff --git a/provider/resource_api_app_configuration.go b/provider/resource_api_app_configuration.go index d3bc983..cf9a734 100644 --- a/provider/resource_api_app_configuration.go +++ b/provider/resource_api_app_configuration.go @@ -36,6 +36,16 @@ func resourceApiAppConfiguration() *schema.Resource { Optional: true, Description: "", }, + "custom_attribute_validation_enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "", + }, + "acr_validation_enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "", + }, "api_approved_issuer": { Type: schema.TypeList, Optional: true, @@ -89,11 +99,6 @@ func resourceApiAppConfiguration() *schema.Resource { Optional: true, Description: "", }, - "smallrye_health_root_path": { - Type: schema.TypeString, - Optional: true, - Description: "", - }, "exclusive_auth_scopes": { Type: schema.TypeList, Optional: true, @@ -319,11 +324,29 @@ func resourceApiAppConfiguration() *schema.Resource { Optional: true, Description: "", }, + "file_extension_validation_enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "", + }, + "module_name_validation_enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "", + }, "asset_base_directory": { Type: schema.TypeString, Optional: true, Description: "", }, + "jans_service_module": { + Type: schema.TypeList, + Optional: true, + Description: "", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, "asset_dir_mappings": { Type: schema.TypeList, Optional: true, diff --git a/provider/resource_api_app_configuration_test.go b/provider/resource_api_app_configuration_test.go index 92c285a..d44ffff 100644 --- a/provider/resource_api_app_configuration_test.go +++ b/provider/resource_api_app_configuration_test.go @@ -29,7 +29,6 @@ func TestResourceApiAppConfiguration_Mapping(t *testing.T) { AuthOpenidIntrospectionUrl: "https://demoexample.gluu.org/jans-auth/restv1/introspection", AuthOpenidTokenUrl: "https://demoexample.gluu.org/jans-auth/restv1/token", AuthOpenidRevokeUrl: "https://demoexample.gluu.org/jans-auth/restv1/revoke", - SmallryeHealthRootPath: "/health-check", ExclusiveAuthScopes: []string{"jans_stat", "https://jans.io/scim/users.read", "https://jans.io/scim/users.write"}, CorsConfigurationFilters: []jans.CorsConfigurationFilter{ { @@ -96,8 +95,8 @@ func TestResourceApiAppConfiguration_Mapping(t *testing.T) { t.Fatal(err) } - if len(patches) != 25 { - t.Errorf("Got %d patches, expected 25", len(patches)) + if len(patches) != 24 { + t.Errorf("Got %d patches, expected 24", len(patches)) } if err := fromSchemaResource(data, &newConfig); err != nil { diff --git a/provider/resource_app_configuration.go b/provider/resource_app_configuration.go index badad7d..d32d260 100755 --- a/provider/resource_app_configuration.go +++ b/provider/resource_app_configuration.go @@ -458,6 +458,26 @@ func resourceAppConfiguration() *schema.Resource { Optional: true, Description: "The lifetime of spontaneous scope in seconds.", }, + "status_list_bit_size": { + Type: schema.TypeInt, + Optional: true, + Description: "The size of status list bit.", + }, + "status_list_response_jwt_signature_algorithm": { + Type: schema.TypeString, + Optional: true, + Description: "The signature algorithm for status list response JWT.", + }, + "status_list_response_jwt_lifetime": { + Type: schema.TypeInt, + Optional: true, + Description: "The lifetime of status list response JWT.", + }, + "status_list_index_allocation_block_size": { + Type: schema.TypeInt, + Optional: true, + Description: "The size of status list index allocation block.", + }, "openid_sub_attribute": { Type: schema.TypeString, Optional: true, @@ -540,7 +560,6 @@ func resourceAppConfiguration() *schema.Resource { "implicit", "password", "refresh_token", - "tx_token", "urn:ietf:params:oauth:grant-type:device_code", "urn:ietf:params:oauth:grant-type:token-exchange", "urn:ietf:params:oauth:grant-type:uma-ticket", @@ -2098,6 +2117,8 @@ func resourceAppConfiguration() *schema.Resource { "INTROSPECTION", "REVOKE_TOKEN", "REVOKE_SESSION", + "GLOBAL_TOKEN_REVOCATION", + "STATUS_LIST", "ACTIVE_SESSION", "END_SESSION", "STATUS_SESSION", diff --git a/provider/resource_attribute_test.go b/provider/resource_attribute_test.go index 8185dcf..18f8a64 100644 --- a/provider/resource_attribute_test.go +++ b/provider/resource_attribute_test.go @@ -36,7 +36,6 @@ func TestResourceAttribute_Mapping(t *testing.T) { Urn: "http://openid.net/specs/openid-connect-core-1_0.html/StandardClaims/birthdate", OxMultiValuedAttribute: false, Custom: false, - Required: false, AdminCanAccess: true, AdminCanView: true, AdminCanEdit: true, @@ -106,7 +105,7 @@ resource "jans_attribute" "test" { "user", "admin", ] - name = "l" + name = "l2" origin = "jansCustomPerson" saml1_uri = "urn:mace:dir:attribute-def:l" saml2_uri = "urn:oid:2.5.4.7" diff --git a/provider/resource_custom_user.go b/provider/resource_custom_user.go index 74ff02a..f66aca9 100644 --- a/provider/resource_custom_user.go +++ b/provider/resource_custom_user.go @@ -105,6 +105,11 @@ func resourceCustomUser() *schema.Resource { }, }, }, + "status": { + Type: schema.TypeString, + Optional: true, + Description: "User status", + }, "custom_attributes": { Type: schema.TypeList, Optional: true, @@ -179,6 +184,10 @@ func resourceCustomUserRead(ctx context.Context, d *schema.ResourceData, meta an return handleNotFoundError(ctx, err, d) } + if len(attr.Authenticator.Authenticators) == 0 { + attr.Authenticator.Authenticators = nil + } + if err := toSchemaResource(d, attr); err != nil { return diag.FromErr(err) } diff --git a/provider/resource_custom_user_test.go b/provider/resource_custom_user_test.go index 94fe284..9bd403e 100644 --- a/provider/resource_custom_user_test.go +++ b/provider/resource_custom_user_test.go @@ -77,7 +77,7 @@ func TestResourceCustomUser_Mapping(t *testing.T) { }, Mail: "exampleUsr1@jans.io", DisplayName: "Default Test User", - JansStatus: "active", + Status: "active", UserPassword: "pwd123", GivenName: "exampleUsr1", } diff --git a/provider/resource_default_authentication_method_test.go b/provider/resource_default_authentication_method_test.go index 0e8be3a..79c64c3 100644 --- a/provider/resource_default_authentication_method_test.go +++ b/provider/resource_default_authentication_method_test.go @@ -18,7 +18,7 @@ func TestResourceDefaultAuthenticationMethod_Mapping(t *testing.T) { data := schema.Data(nil) acr := jans.DefaultAuthenticationMethod{ - DefaultAcr: "pwd", + DefaultAcr: "simple_password_auth", } if err := toSchemaResource(data, acr); err != nil { @@ -72,7 +72,7 @@ func testAccResourceCheckDefaultAuthenticationMethodImport(states []*terraform.I found = true - if err := checkAttribute(is, "default_acr", "token"); err != nil { + if err := checkAttribute(is, "default_acr", "simple_password_auth"); err != nil { return err } diff --git a/provider/resource_fido2_configuration_test.go b/provider/resource_fido2_configuration_test.go index bd5c0d3..55e14ad 100644 --- a/provider/resource_fido2_configuration_test.go +++ b/provider/resource_fido2_configuration_test.go @@ -112,11 +112,11 @@ func testAccResourceCheckFido2ConfigurationImport(states []*terraform.InstanceSt found = true - if err := checkAttribute(is, "clean_service_batch_chunk_size", "100"); err != nil { + if err := checkAttribute(is, "clean_service_batch_chunk_size", "10000"); err != nil { return err } - if err := checkAttribute(is, "logging_level", ""); err != nil { + if err := checkAttribute(is, "logging_level", "INFO"); err != nil { return err } diff --git a/provider/resource_kc_saml_config.go b/provider/resource_kc_saml_config.go index 4798e8a..ef87b66 100644 --- a/provider/resource_kc_saml_config.go +++ b/provider/resource_kc_saml_config.go @@ -152,10 +152,15 @@ func resourceKCSamlConfiguration() *schema.Resource { Description: "SP Metadata File.", }, "ignore_validation": { - Type: schema.TypeString, + Type: schema.TypeBool, Optional: true, Description: "Ignore Validation.", }, + "set_config_default_value": { + Type: schema.TypeBool, + Optional: true, + Description: "Set Config Default Value.", + }, "idp_metadata_mandatory_attributes": { Type: schema.TypeList, Optional: true, diff --git a/provider/resource_kc_saml_idp.go b/provider/resource_kc_saml_idp.go index 1d58c7c..4421744 100644 --- a/provider/resource_kc_saml_idp.go +++ b/provider/resource_kc_saml_idp.go @@ -79,6 +79,16 @@ func resourceKCSamlIDP() *schema.Resource { Optional: true, Description: "Name ID policy format of the identity provider.", }, + "principal_attribute": { + Type: schema.TypeString, + Optional: true, + Description: "Principal attribute of the identity provider.", + }, + "principal_type": { + Type: schema.TypeString, + Optional: true, + Description: "Principal type of the identity provider.", + }, "idp_entity_id": { Type: schema.TypeString, Optional: true, diff --git a/provider/resource_kc_saml_tr.go b/provider/resource_kc_saml_tr.go index d2de507..4a5af25 100644 --- a/provider/resource_kc_saml_tr.go +++ b/provider/resource_kc_saml_tr.go @@ -55,21 +55,6 @@ func resourceKCSamlTR() *schema.Resource { Optional: true, Description: "Root URL of the trust relationship.", }, - "admin_url": { - Type: schema.TypeString, - Optional: true, - Description: "Admin URL of the trust relationship.", - }, - "base_url": { - Type: schema.TypeString, - Optional: true, - Description: "Base URL of the trust relationship.", - }, - "surrogate_auth_required": { - Type: schema.TypeBool, - Optional: true, - Description: "Surrogate auth required of the trust relationship.", - }, "enabled": { Type: schema.TypeBool, Optional: true, @@ -164,11 +149,6 @@ func resourceKCSamlTR() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, Description: "Released attributes of the trust relationship.", }, - "url": { - Type: schema.TypeString, - Optional: true, - Description: "URL of the trust relationship.", - }, "sp_logout_url": { Type: schema.TypeString, Optional: true, diff --git a/provider/resource_organization_test.go b/provider/resource_organization_test.go index 6949164..5290cdb 100644 --- a/provider/resource_organization_test.go +++ b/provider/resource_organization_test.go @@ -88,7 +88,7 @@ func testAccResourceCheckOrganizationImport(states []*terraform.InstanceState) e found = true - if err := checkAttribute(is, "display_name", "Gluu"); err != nil { + if err := checkAttribute(is, "display_name", "gluu"); err != nil { return err } diff --git a/provider/resource_scim_app_configuration.go b/provider/resource_scim_app_configuration.go index 2533dea..8164ddb 100644 --- a/provider/resource_scim_app_configuration.go +++ b/provider/resource_scim_app_configuration.go @@ -25,6 +25,16 @@ func resourceScimAppConfiguration() *schema.Resource { Optional: true, Description: "Application config Base DN", }, + "disable_logger_timer": { + Type: schema.TypeBool, + Optional: true, + Description: "", + }, + "disable_audit_logger": { + Type: schema.TypeBool, + Optional: true, + Description: "", + }, "application_url": { Type: schema.TypeString, Optional: true, diff --git a/provider/resource_script.go b/provider/resource_script.go index 76d3d73..4e11c9c 100644 --- a/provider/resource_script.go +++ b/provider/resource_script.go @@ -81,6 +81,7 @@ func resourceScript() *schema.Resource { "spontaneous_scope", "end_session", "post_authn", + "client_authn", "select_account", "create_user", "scim",