Commit Graph
21 Commits
Author SHA1 Message Date
Zac Bergquist 2ae9d770fc Refactor tctl's dependencies (#22693)
* Move configuration from lib/service to lib/service/servicecfg

The new servicecfg package will hold only configuration for services.
This will allow other packages (like tctl and tsh) to depend on
servicecfg without pulling in all of lib/service (which has a number
of platform-specific details).

This is the first step towards being able to build tctl for Windows.

* Move PAM and BPF config into servicecfg

This breaks a compile-time dependency on BPF/PAM for tctl.
2023-03-09 17:48:36 +00:00
Jakub Nyckowski 0ee91f6c37 Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
Lisa Kim 8bb0636863 Partial delete deprecated code for "DELETE IN 11.0.0" and lower (#16947)
* Deleted 
   - GetAppServers
   - GetApplicationServers 
   - GetDatabaseServers 
   - GetKubeService 
   - UpsertAppServer
   - DeleteAppServer
   - DeleteAllAppServers
   - RotateUserTokenSecrets
* Delete list nodes fallback
* Use AppServer type for heartbeat test
2022-10-04 17:58:30 +00:00
Garrett Watson 68524143ed Remove the "." from the end of the auth token generated by "tctl tokens add" command (#16157) 2022-09-07 10:00:48 +00:00
Håkon SolbjørgandRoman Tkachenko 6f73b82935 fix(teleport/db-create): Use --proxy instead of --auth-server in example command (#12834)
`teleport db create` uses --proxy and not --auth-server.

See this example (some output removed for brevity):
```
$ tctl tokens add --type=db,node
*snip*
Or, generate the configuration and start a Teleport agent using it:

> teleport db configure create \
   --token=... \
   --ca-pin=... \
   --auth-server=my-server.example.org \
   --output file:///etc/teleport.yaml

> teleport start -c /etc/teleport.yaml

$ teleport db configure create \
>    --token=... \
>    --ca-pin=... \
>    --auth-server=my-server.example.org \
>    --output file:///tmp/foo.yml
teleport: error: unknown long flag '--auth-server'
```

Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2022-06-02 22:46:39 +00:00
Noah Stride 18558b88e9 thread context.Context from tctl Run() to subcommands (#13029) 2022-06-01 12:49:59 +01:00
Lisa Kim 6116ccf37a Improve error message for resource predicate query (#12262) 2022-04-29 21:29:27 +00:00
Alex McGrath 40200e8536 Reslove comments, move all occurences of teleport.dev to use a constant 2022-03-15 13:22:45 +00:00
Alex McGrath 19270c1e71 Resolve comments 2022-03-15 13:22:45 +00:00
Alex McGrath b6df9a742a Add verbosity to tctl * ls commands and resource get. 2022-03-15 13:22:45 +00:00
Lisa Kim 628564c801 Update 'tctl apps/db/nodes ls' to accept filter flags (#11003) 2022-03-11 17:57:40 +00:00
Gabriel Corado df68e73864 feat: add create database config command (#9618) 2022-02-10 17:56:42 +00:00
Nic Klaassen c9fda499de Add support for multiple CA pins (#7905) 2021-08-18 20:13:20 -07:00
Roman Tkachenko 25aeeae3ac Adding database resource API and tctl commands (#7792) 2021-08-09 07:14:39 -07:00
Brian Joerger 9b8b9d6d0c rollback - Upgrade api version. (#7751) 2021-07-30 15:34:19 -07:00
Brian Joerger c040aca4c1 Upgrade api version. (#7609) 2021-07-28 13:51:21 -07:00
Brian Joerger 4d36870ff0 Remove remaining API aliases (#7137) 2021-06-08 12:08:55 -07:00
Andrew Lytvynov cd2f4fceb7 Remove JSON schema validation (#6685)
* Remove JSON schema validation

Removing JSON schema validation from all resource unmarshalers.

--- what JSON schema gets us

Looking at the JSON schema spec and our usage, here are the supposed benefits:
- type validation - make sure incoming data uses the right types for the right fields
- required fields - make sure that mandatory fields are set
- defaulting - set defaults for fields
- documentation - schema definition for our API objects

Note that it does _not_ do:
- fail on unknown fields in data
- fail on a required field with an empty value

--- what replaces it

Based on the above, it may seem like JSON schema provides value.
But it's not the case, let's break it down one by one:
- type validation - unmarshaling JSON into a typed Go struct does this
- required fields - only checks that the field was provided, doesn't actually check that a value is set (e.g. `"name": ""` will pass the `required` check)
  - so it's pretty useless for any real validation
  - and we already have a separate place for proper validation - `CheckAndSetDefaults` methods
- defaulting - done in `CheckAndSetDefaults` methods
  - `Version` is the only annoying field, had to add it in a bunch of objects
- documentation - protobuf definitions are the source of truth for our API schema

--- the benefits

- performance - schema validation does a few rounds of `json.Marshal/Unmarshal` in addition to actual validation; now we simply skip all that
- maintenance - no need to keep protobuf and JSON schema definitions in sync anymore
- creating new API objects - one error-prone step removed
- (future) fewer dependencies - we can _almost_ remove the Go libraries for schema validation (one transient dependency keeping them around)

* Remove services.SkipValidation

No more JSON schema validation so this option is a noop.
2021-06-01 15:27:20 -07:00
Roman Tkachenko 6be68ff055 Add missing database cli flags (#6739) 2021-05-18 11:10:16 -07:00
Roman Tkachenko 92c03df14c Rename database role to db (#5359) 2021-01-21 10:14:07 -08:00
Roman Tkachenko 8e1865464b Database access (#5005) 2021-01-14 18:21:38 -08:00