• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Twingate / terraform-provider-twingate / 20759866553

06 Jan 2026 07:38PM UTC coverage: 88.615% (-0.07%) from 88.687%
20759866553

push

github

web-flow
Add JIT access support (#805)

883 of 986 new or added lines in 12 files covered. (89.55%)

8 existing lines in 2 files now uncovered.

9628 of 10865 relevant lines covered (88.61%)

2.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

74.07
/twingate/internal/customplanmodifier/stringplanmodifier_duration.go
1
package customplanmodifier
2

3
import (
4
        "context"
5

6
        "github.com/Twingate/terraform-provider-twingate/v3/twingate/internal/utils"
7
        "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
8
        "github.com/hashicorp/terraform-plugin-framework/types"
9
)
10

11
func Duration() planmodifier.String {
3✔
12
        return duration{}
3✔
13
}
3✔
14

15
type duration struct{}
16

17
func (m duration) Description(_ context.Context) string {
2✔
18
        return ""
2✔
19
}
2✔
20

NEW
21
func (m duration) MarkdownDescription(_ context.Context) string {
×
NEW
22
        return ""
×
NEW
23
}
×
24

25
func (m duration) PlanModifyString(ctx context.Context, req planmodifier.StringRequest, resp *planmodifier.StringResponse) {
2✔
26
        // Do nothing if there is no state value.
2✔
27
        if req.StateValue.IsNull() {
4✔
28
                return
2✔
29
        }
2✔
30

31
        if equalDuration(req.StateValue, req.PlanValue) {
4✔
32
                resp.PlanValue = req.StateValue
2✔
33
        }
2✔
34
}
35

36
func equalDuration(stateDuration, planDuraion types.String) bool {
2✔
37
        stateVal, err := utils.ParseDurationWithDays(stateDuration.ValueString())
2✔
38
        if err != nil {
2✔
NEW
39
                return false
×
NEW
40
        }
×
41

42
        planVal, err := utils.ParseDurationWithDays(planDuraion.ValueString())
2✔
43
        if err != nil {
2✔
NEW
44
                return false
×
NEW
45
        }
×
46

47
        return stateVal == planVal
2✔
48
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc