Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
introduce token_lifetime_for_web (#84)
Browse files Browse the repository at this point in the history
* introduce token_lifetime_for_web

* fix test
  • Loading branch information
alexkappa authored Mar 6, 2019
1 parent f202d79 commit 12e9c97
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions auth0/resource_auth0_resource_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand All @@ -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"),
Expand Down
6 changes: 4 additions & 2 deletions auth0/resource_auth0_resource_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
},
Expand All @@ -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
}
`

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 12e9c97

Please sign in to comment.