diff --git a/Gopkg.lock b/Gopkg.lock index 403fe37f..4f3341dc 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -438,15 +438,15 @@ version = "v0.5.4" [[projects]] - digest = "1:12fa5858a8359400e6f79a8a114e68328e0968a3fecca4f36dce8f752158076f" + digest = "1:8b67492c0c0ae2112754e36a6bc35525361a88014c67762723a614e62f82f5c5" name = "github.com/yieldr/go-auth0" packages = [ ".", "management", ] pruneopts = "UT" - revision = "58a4d3f2002c48defb5cf0d943551f08b77f1f2d" - version = "v1.0.1" + revision = "5e90dfea1b93ab8dd9f540da8e577c46911b1707" + version = "v1.0.2" [[projects]] branch = "master" diff --git a/auth0/resource_auth0_resource_server.go b/auth0/resource_auth0_resource_server.go index 9c84509c..89cfc92e 100644 --- a/auth0/resource_auth0_resource_server.go +++ b/auth0/resource_auth0_resource_server.go @@ -61,6 +61,11 @@ func newResourceServer() *schema.Resource { Optional: true, Computed: true, }, + "token_lifetime_for_web": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, "skip_consent_for_verifiable_first_party_clients": { Type: schema.TypeBool, Optional: true, @@ -110,6 +115,7 @@ func readResourceServer(d *schema.ResourceData, m interface{}) error { d.Set("signing_secret", s.SigningSecret) d.Set("allow_offline_access", s.AllowOfflineAccess) d.Set("token_lifetime", s.TokenLifetime) + d.Set("token_lifetime_for_web", s.TokenLifetimeForWeb) d.Set("skip_consent_for_verifiable_first_party_clients", s.SkipConsentForVerifiableFirstPartyClients) d.Set("verification_location", s.VerificationLocation) d.Set("options", s.Options) @@ -135,12 +141,13 @@ func deleteResourceServer(d *schema.ResourceData, m interface{}) error { func buildResourceServer(d *schema.ResourceData) *management.ResourceServer { s := &management.ResourceServer{ - Name: String(d, "name"), - Identifier: String(d, "identifier"), - SigningAlgorithm: String(d, "signing_alg"), - SigningSecret: String(d, "signing_secret"), - AllowOfflineAccess: Bool(d, "allow_offline_access"), - TokenLifetime: Int(d, "token_lifetime"), + Name: String(d, "name"), + Identifier: String(d, "identifier"), + SigningAlgorithm: String(d, "signing_alg"), + SigningSecret: String(d, "signing_secret"), + AllowOfflineAccess: Bool(d, "allow_offline_access"), + TokenLifetime: Int(d, "token_lifetime"), + TokenLifetimeForWeb: Int(d, "token_lifetime_for_web"), SkipConsentForVerifiableFirstPartyClients: Bool(d, "skip_consent_for_verifiable_first_party_clients"), VerificationLocation: String(d, "verification_location"), Options: Map(d, "options"), diff --git a/auth0/resource_auth0_resource_server_test.go b/auth0/resource_auth0_resource_server_test.go index b48cccb7..82c3f2e1 100644 --- a/auth0/resource_auth0_resource_server_test.go +++ b/auth0/resource_auth0_resource_server_test.go @@ -21,7 +21,8 @@ func TestAccResourceServer(t *testing.T) { resource.TestCheckResourceAttr("auth0_resource_server.my_resource_server", "identifier", "https://api.example.com/v2"), resource.TestCheckResourceAttr("auth0_resource_server.my_resource_server", "signing_alg", "RS256"), resource.TestCheckResourceAttr("auth0_resource_server.my_resource_server", "allow_offline_access", "true"), - resource.TestCheckResourceAttr("auth0_resource_server.my_resource_server", "token_lifetime", "8600"), + resource.TestCheckResourceAttr("auth0_resource_server.my_resource_server", "token_lifetime", "7200"), + resource.TestCheckResourceAttr("auth0_resource_server.my_resource_server", "token_lifetime_for_web", "3600"), resource.TestCheckResourceAttr("auth0_resource_server.my_resource_server", "skip_consent_for_verifiable_first_party_clients", "true"), ), }, @@ -45,7 +46,8 @@ resource "auth0_resource_server" "my_resource_server" { description = "Create bars" } allow_offline_access = true - token_lifetime = 8600 + token_lifetime = 7200 + token_lifetime_for_web = 3600 skip_consent_for_verifiable_first_party_clients = true } ` diff --git a/vendor/github.com/yieldr/go-auth0/management/resource_server.go b/vendor/github.com/yieldr/go-auth0/management/resource_server.go index e6d6ab97..435d8395 100644 --- a/vendor/github.com/yieldr/go-auth0/management/resource_server.go +++ b/vendor/github.com/yieldr/go-auth0/management/resource_server.go @@ -30,6 +30,11 @@ type ResourceServer struct { // issued. TokenLifetime *int `json:"token_lifetime,omitempty"` + // The amount of time in seconds that the token will be valid after being + // issued from browser based flows. Value cannot be larger than + // token_lifetime. + TokenLifetimeForWeb *int `json:"token_lifetime_for_web,omitempty"` + // Flag this entity as capable of skipping consent SkipConsentForVerifiableFirstPartyClients *bool `json:"skip_consent_for_verifiable_first_party_clients,omitempty"`