Skip to content

Commit

Permalink
v0.1.6 service: rename probe to verify
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus committed Oct 30, 2024
1 parent 5b34c9a commit 3d6f325
Show file tree
Hide file tree
Showing 22 changed files with 281 additions and 272 deletions.
6 changes: 3 additions & 3 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ var rootDef = CmdDef{
Short: "Fetch Environment Variables for Service",
},
{
Name: "probe",
Name: "verify",

Use: "probe <service> [flags]",
Use: "verify <service> [flags]",
Args: cobra.NoArgs,
Short: "Probe a service for proper TLS setup & configuration",
Short: "Verify Service TLS Setup and Configuration",
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ type Config struct {
EnvOutput string `env:"ENV_OUTPUT" toml:",omitempty,readonly"`
CertStyle string `env:"CERT_STYLE" toml:"cert-style,omitempty"`

Probe struct {
Timeout time.Duration `default:"2m" env:"PROBE_TIMEOUT" toml:",omitempty,readonly"`
Verify struct {
Timeout time.Duration `default:"2m" env:"VERIFY_TIMEOUT" toml:",omitempty,readonly"`
} `toml:",omitempty,readonly"`
} `toml:"service,omitempty"`

Expand Down
2 changes: 1 addition & 1 deletion lcl/testdata/TestLcl/non-personal-cas-missing-unix.golden
Original file line number Diff line number Diff line change
Expand Up @@ -570,5 +570,5 @@

# Next Steps
! (Re)Start your server.
! Check out your encrypted site: https://service.lcl.host:4433
! Verify TLS setup and configuration: run `anchor service verify --org ankyco --realm development --service service-name`.
| These certificates will renew automatically, time to enjoy effortless encryption.
Original file line number Diff line number Diff line change
Expand Up @@ -572,5 +572,5 @@

# Next Steps
! (Re)Start your server.
! Check out your encrypted site: https://service.lcl.host:4433
! Verify TLS setup and configuration: run `anchor service verify --org ankyco --realm development --service service-name`.
| These certificates will renew automatically, time to enjoy effortless encryption.
2 changes: 1 addition & 1 deletion lcl/testdata/TestSetup/existing-service-basics-unix.golden
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,5 @@

# Next Steps
! (Re)Start your server.
! Check out your encrypted site: https://service.lcl.host:4433
! Verify TLS setup and configuration: run `anchor service verify --org org-slug --realm realm-slug --service service-name`.
| These certificates will renew automatically, time to enjoy effortless encryption.
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,5 @@

# Next Steps
! (Re)Start your server.
! Check out your encrypted site: https://service.lcl.host:4433
! Verify TLS setup and configuration: run `anchor service verify --org org-slug --realm realm-slug --service service-name`.
| These certificates will renew automatically, time to enjoy effortless encryption.
5 changes: 4 additions & 1 deletion service/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ func (c *Env) Perform(ctx context.Context, drv *ui.Driver) error {
}

drv.Activate(ctx, &models.EnvNextSteps{
LclUrl: lclUrl,
LclUrl: lclUrl,
OrgApid: orgAPID,
RealmApid: realmAPID,
ServiceApid: serviceAPID,
})

return nil
Expand Down
10 changes: 8 additions & 2 deletions service/models/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (m *EnvDisplay) View() string {
}

type EnvNextSteps struct {
LclUrl string
LclUrl, OrgApid, RealmApid, ServiceApid string
}

func (m *EnvNextSteps) Init() tea.Cmd { return nil }
Expand All @@ -224,7 +224,13 @@ func (m *EnvNextSteps) View() string {
fmt.Fprintln(&b, ui.Header("Next Steps"))
fmt.Fprintln(&b, ui.StepAlert(ui.Action("(Re)Start your server.")))
if m.LclUrl != "" {
fmt.Fprintln(&b, ui.StepAlert(fmt.Sprintf("%s: %s", ui.Action("Check out your encrypted site"), ui.URL(m.LclUrl))))
fmt.Fprintln(&b, ui.StepAlert(
fmt.Sprintf("%s: run `anchor service verify --org %s --realm %s --service %s`.",
ui.Action("Verify TLS setup and configuration"),
m.OrgApid,
m.RealmApid,
m.ServiceApid,
)))
}
fmt.Fprintln(&b, ui.StepHint("These certificates will renew automatically, time to enjoy effortless encryption."))

Expand Down
10 changes: 5 additions & 5 deletions service/models/probe.go → service/models/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import (
)

var (
ProbeHeader = ui.Section{
Name: "ProbeHeader",
VerifyHeader = ui.Section{
Name: "VerifyHeader",
Model: ui.MessageLines{
ui.Header(fmt.Sprintf("Probe Service TLS Setup and Configuration %s", ui.Whisper("`anchor service probe`"))),
ui.Header(fmt.Sprintf("Verify Service TLS Setup and Configuration %s", ui.Whisper("`anchor service verify`"))),
},
}

ProbeHint = ui.Section{
Name: "ProbeHint",
VerifyHint = ui.Section{
Name: "VerifyHint",
Model: ui.MessageLines{
ui.StepHint("We'll check your running app to ensure TLS works as expected."),
},
Expand Down
16 changes: 0 additions & 16 deletions service/testdata/TestCmdServiceProbe/--help.golden

This file was deleted.

16 changes: 16 additions & 0 deletions service/testdata/TestCmdServiceVerify/--help.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Verify Service TLS Setup and Configuration

Usage:
anchor service verify <service> [flags]

Flags:
-h, --help help for verify
-o, --org string Organization of the service to verify.
-r, --realm string Realm instance of the service to verify.
-s, --service string Service to verify.
--timeout duration Time to wait for a successful verification of the service. (default 2m0s)

Global Flags:
--api-token string Anchor API personal access token (PAT).
--config string Service configuration file. (default "anchor.toml")
--skip-config Skip loading configuration file.
2 changes: 1 addition & 1 deletion service/testdata/TestServiceEnv/basics_display.golden
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,5 @@ export SERVER_NAMES="service.lcl.host"

# Next Steps
! (Re)Start your server.
! Check out your encrypted site: https://service.lcl.host:4433
! Verify TLS setup and configuration: run `anchor service verify --org org-slug --realm realm-slug --service service-name`.
| These certificates will renew automatically, time to enjoy effortless encryption.
2 changes: 1 addition & 1 deletion service/testdata/TestServiceEnv/basics_dotenv.golden
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@

# Next Steps
! (Re)Start your server.
! Check out your encrypted site: https://service.lcl.host:4433
! Verify TLS setup and configuration: run `anchor service verify --org org-slug --realm realm-slug --service service-name`.
| These certificates will renew automatically, time to enjoy effortless encryption.
2 changes: 1 addition & 1 deletion service/testdata/TestServiceEnv/basics_export.golden
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@

# Next Steps
! (Re)Start your server.
! Check out your encrypted site: https://service.lcl.host:4433
! Verify TLS setup and configuration: run `anchor service verify --org org-slug --realm realm-slug --service service-name`.
| These certificates will renew automatically, time to enjoy effortless encryption.
Original file line number Diff line number Diff line change
@@ -1,97 +1,97 @@
─── ProbeHeader ────────────────────────────────────────────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
─── ProbeHint ──────────────────────────────────────────────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
─── VerifyHeader ───────────────────────────────────────────────────────────────
# Verify Service TLS Setup and Configuration `anchor service verify`
─── VerifyHint ─────────────────────────────────────────────────────────────────
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
─── Client ─────────────────────────────────────────────────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
* Checking authentication: probing credentials locally…⠋
─── Client ─────────────────────────────────────────────────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
* Checking authentication: testing credentials remotely…⠋
─── Client ─────────────────────────────────────────────────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
─── Fetcher[github.com/anchordotdev/cli/api.Organization] ──────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
* Fetching organizations…⠋
─── Fetcher[github.com/anchordotdev/cli/api.Organization] ──────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
- Using ankydotdev, the only available organization. You can also use `--org ankydotdev`.
─── Fetcher[github.com/anchordotdev/cli/api.Service] ───────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
- Using ankydotdev, the only available organization. You can also use `--org ankydotdev`.
* Fetching services…⠋
─── Fetcher[github.com/anchordotdev/cli/api.Service] ───────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
- Using ankydotdev, the only available organization. You can also use `--org ankydotdev`.
- Using ankydotdev, the only available service. You can also use `--service ankydotdev`.
─── Fetcher[github.com/anchordotdev/cli/api.Realm] ─────────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
- Using ankydotdev, the only available organization. You can also use `--org ankydotdev`.
- Using ankydotdev, the only available service. You can also use `--service ankydotdev`.
* Fetching realms…⠋
─── Fetcher[github.com/anchordotdev/cli/api.Realm] ─────────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
- Using ankydotdev, the only available organization. You can also use `--org ankydotdev`.
- Using ankydotdev, the only available service. You can also use `--service ankydotdev`.
- Using localhost, the only available realm. You can also use `--realm localhost`.
─── Checker ────────────────────────────────────────────────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
- Using ankydotdev, the only available organization. You can also use `--org ankydotdev`.
- Using ankydotdev, the only available service. You can also use `--service ankydotdev`.
- Using localhost, the only available realm. You can also use `--realm localhost`.
* Checking DNS ankydotdev.lcl.host…⠋
─── Checker ────────────────────────────────────────────────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
- Using ankydotdev, the only available organization. You can also use `--org ankydotdev`.
- Using ankydotdev, the only available service. You can also use `--service ankydotdev`.
- Using localhost, the only available realm. You can also use `--realm localhost`.
- Checked DNS ankydotdev.lcl.host: success!
─── Checker ────────────────────────────────────────────────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
- Using ankydotdev, the only available organization. You can also use `--org ankydotdev`.
- Using ankydotdev, the only available service. You can also use `--service ankydotdev`.
- Using localhost, the only available realm. You can also use `--realm localhost`.
- Checked DNS ankydotdev.lcl.host: success!
* Checking TCP [[::1]:<service-port>, 127.0.0.1:<service-port>]…⠋
─── Checker ────────────────────────────────────────────────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
- Using ankydotdev, the only available organization. You can also use `--org ankydotdev`.
- Using ankydotdev, the only available service. You can also use `--service ankydotdev`.
- Using localhost, the only available realm. You can also use `--realm localhost`.
- Checked DNS ankydotdev.lcl.host: success!
- Checked TCP [[::1]:<service-port>, 127.0.0.1:<service-port>]: success!
─── Checker ────────────────────────────────────────────────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
- Using ankydotdev, the only available organization. You can also use `--org ankydotdev`.
- Using ankydotdev, the only available service. You can also use `--service ankydotdev`.
Expand All @@ -100,8 +100,8 @@
- Checked TCP [[::1]:<service-port>, 127.0.0.1:<service-port>]: success!
* Checking TLS ankydotdev.lcl.host…⠋
─── Checker ────────────────────────────────────────────────────────────────────

# Probe Service TLS Setup and Configuration `anchor service probe`
# Verify Service TLS Setup and Configuration `anchor service verify`
| We'll check your running app to ensure TLS works as expected.
- Using ankydotdev, the only available organization. You can also use `--org ankydotdev`.
- Using ankydotdev, the only available service. You can also use `--service ankydotdev`.
Expand Down
Loading

0 comments on commit 3d6f325

Please sign in to comment.