From 32cb12e2864d557d7eacd8636bb05d54e57bea71 Mon Sep 17 00:00:00 2001 From: Johan Siebens Date: Sat, 2 Jul 2022 08:31:59 +0200 Subject: [PATCH] chore: remove auth method and configure oidc via config file --- internal/cmd/auth_method.go | 171 ---- internal/cmd/funcs.go | 39 - internal/cmd/root.go | 1 - internal/config/config.go | 12 +- internal/database/database.go | 1 - internal/domain/account.go | 24 +- internal/domain/api_key.go | 17 - internal/domain/auth_key.go | 17 - internal/domain/auth_method.go | 55 -- internal/domain/machine.go | 55 -- internal/domain/repository.go | 14 +- internal/domain/user.go | 17 - internal/handlers/authentication.go | 113 +-- internal/provider/oidc.go | 11 +- internal/provider/providers.go | 15 - internal/server/server.go | 69 +- internal/service/auth.go | 10 +- internal/service/auth_method.go | 142 ---- internal/service/service.go | 17 +- internal/templates/auth.html | 8 +- internal/templates/cli_auth.html | 10 +- pkg/gen/ionscale/v1/auth_filter.pb.go | 582 -------------- pkg/gen/ionscale/v1/auth_methods.pb.go | 737 ------------------ pkg/gen/ionscale/v1/ionscale.pb.go | 231 +++--- .../v1/ionscalev1connect/ionscale.connect.go | 88 --- proto/ionscale/v1/auth_methods.proto | 46 -- proto/ionscale/v1/ionscale.proto | 6 - 27 files changed, 200 insertions(+), 2308 deletions(-) delete mode 100644 internal/cmd/auth_method.go delete mode 100644 internal/domain/auth_method.go delete mode 100644 internal/service/auth_method.go delete mode 100644 pkg/gen/ionscale/v1/auth_filter.pb.go delete mode 100644 pkg/gen/ionscale/v1/auth_methods.pb.go delete mode 100644 proto/ionscale/v1/auth_methods.proto diff --git a/internal/cmd/auth_method.go b/internal/cmd/auth_method.go deleted file mode 100644 index 7c23ec5..0000000 --- a/internal/cmd/auth_method.go +++ /dev/null @@ -1,171 +0,0 @@ -package cmd - -import ( - "context" - "fmt" - "github.com/bufbuild/connect-go" - api "github.com/jsiebens/ionscale/pkg/gen/ionscale/v1" - "github.com/muesli/coral" - "github.com/rodaine/table" -) - -func authMethodsCommand() *coral.Command { - command := &coral.Command{ - Use: "auth-methods", - Short: "Manage ionscale auth methods", - SilenceUsage: true, - } - - command.AddCommand(listAuthMethods()) - command.AddCommand(createAuthMethodCommand()) - command.AddCommand(deleteAuthMethodCommand()) - - return command -} - -func listAuthMethods() *coral.Command { - command := &coral.Command{ - Use: "list", - Short: "List auth methods", - SilenceUsage: true, - } - - var target = Target{} - target.prepareCommand(command) - - command.RunE = func(command *coral.Command, args []string) error { - - client, err := target.createGRPCClient() - if err != nil { - return err - } - - resp, err := client.ListAuthMethods(context.Background(), connect.NewRequest(&api.ListAuthMethodsRequest{})) - - if err != nil { - return err - } - - tbl := table.New("ID", "NAME", "TYPE") - for _, m := range resp.Msg.AuthMethods { - tbl.AddRow(m.Id, m.Name, m.Type) - } - tbl.Print() - - return nil - } - - return command -} - -func deleteAuthMethodCommand() *coral.Command { - command := &coral.Command{ - Use: "delete", - Short: "Delete auth methods", - SilenceUsage: true, - } - - var authMethodID uint64 - var authMethodName string - var force bool - var target = Target{} - target.prepareCommand(command) - - command.Flags().StringVar(&authMethodName, "auth-method", "", "Auth Method name. Mutually exclusive with --auth-method-id.") - command.Flags().Uint64Var(&authMethodID, "auth-method-id", 0, "Auth Method ID. Mutually exclusive with --auth-method.") - command.Flags().BoolVar(&force, "force", false, "When enabled, force delete the specified Auth Method even when machines are still available.") - - command.PreRunE = checkRequiredAuthMethodAndAuthMethodIdFlags - command.RunE = func(command *coral.Command, args []string) error { - client, err := target.createGRPCClient() - if err != nil { - return err - } - - method, err := findAuthMethod(client, authMethodName, authMethodID) - if err != nil { - return err - } - - _, err = client.DeleteAuthMethod(context.Background(), connect.NewRequest(&api.DeleteAuthMethodRequest{AuthMethodId: method.Id, Force: force})) - - if err != nil { - return err - } - - fmt.Println("Auth Method deleted.") - - return nil - } - - return command -} - -func createAuthMethodCommand() *coral.Command { - command := &coral.Command{ - Use: "create", - Short: "Create a new auth method", - SilenceUsage: true, - } - - command.AddCommand(createOIDCAuthMethodCommand()) - - return command -} - -func createOIDCAuthMethodCommand() *coral.Command { - command := &coral.Command{ - Use: "oidc", - Short: "Create a new auth method", - SilenceUsage: true, - } - - var methodName string - - var clientId string - var clientSecret string - var issuer string - - var target = Target{} - - target.prepareCommand(command) - command.Flags().StringVarP(&methodName, "name", "n", "", "") - command.Flags().StringVar(&clientId, "client-id", "", "") - command.Flags().StringVar(&clientSecret, "client-secret", "", "") - command.Flags().StringVar(&issuer, "issuer", "", "") - - _ = command.MarkFlagRequired("name") - _ = command.MarkFlagRequired("client-id") - _ = command.MarkFlagRequired("client-secret") - _ = command.MarkFlagRequired("issuer") - - command.RunE = func(command *coral.Command, args []string) error { - - client, err := target.createGRPCClient() - if err != nil { - return err - } - - req := &api.CreateAuthMethodRequest{ - Type: "oidc", - Name: methodName, - Issuer: issuer, - ClientId: clientId, - ClientSecret: clientSecret, - } - - resp, err := client.CreateAuthMethod(context.Background(), connect.NewRequest(req)) - - if err != nil { - return err - } - - tbl := table.New("ID", "NAME", "TYPE") - tbl.AddRow(resp.Msg.AuthMethod.Id, resp.Msg.AuthMethod.Name, resp.Msg.AuthMethod.Type) - tbl.Print() - - return nil - } - - return command -} diff --git a/internal/cmd/funcs.go b/internal/cmd/funcs.go index bd92886..17cf12d 100644 --- a/internal/cmd/funcs.go +++ b/internal/cmd/funcs.go @@ -32,26 +32,6 @@ func checkRequiredTailnetAndTailnetIdFlags(cmd *coral.Command, args []string) er return nil } -func checkRequiredAuthMethodAndAuthMethodIdFlags(cmd *coral.Command, args []string) error { - if !cmd.Flags().Changed("auth-method") && !cmd.Flags().Changed("auth-method-id") { - return fmt.Errorf("flag --auth-method or --auth-method-id is required") - } - - if cmd.Flags().Changed("auth-method") && cmd.Flags().Changed("auth-method-id") { - return fmt.Errorf("flags --auth-method and --auth-method-id are mutually exclusive") - } - - return nil -} - -func checkOptionalAuthMethodAndAuthMethodIdFlags(cmd *coral.Command, args []string) error { - if cmd.Flags().Changed("auth-method") && cmd.Flags().Changed("auth-method-id") { - return fmt.Errorf("flags --auth-method and --auth-method-id are mutually exclusive") - } - - return nil -} - func findTailnet(client apiconnect.IonscaleServiceClient, tailnet string, tailnetID uint64) (*api.Tailnet, error) { if tailnetID == 0 && tailnet == "" { return nil, fmt.Errorf("requested tailnet not found or you are not authorized for this tailnet") @@ -70,22 +50,3 @@ func findTailnet(client apiconnect.IonscaleServiceClient, tailnet string, tailne return nil, fmt.Errorf("requested tailnet not found or you are not authorized for this tailnet") } - -func findAuthMethod(client apiconnect.IonscaleServiceClient, authMethod string, authMethodID uint64) (*api.AuthMethod, error) { - if authMethodID == 0 && authMethod == "" { - return nil, fmt.Errorf("requested auth method not found or you are not authorized for this auth method") - } - - resp, err := client.ListAuthMethods(context.Background(), connect.NewRequest(&api.ListAuthMethodsRequest{})) - if err != nil { - return nil, err - } - - for _, t := range resp.Msg.AuthMethods { - if t.Id == authMethodID || t.Name == authMethod { - return t, nil - } - } - - return nil, fmt.Errorf("requested auth method not found or you are not authorized for this auth method") -} diff --git a/internal/cmd/root.go b/internal/cmd/root.go index a620b29..4124a92 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -11,7 +11,6 @@ func Command() *coral.Command { rootCmd.AddCommand(derpMapCommand()) rootCmd.AddCommand(serverCommand()) rootCmd.AddCommand(versionCommand()) - rootCmd.AddCommand(authMethodsCommand()) rootCmd.AddCommand(tailnetCommand()) rootCmd.AddCommand(authkeysCommand()) rootCmd.AddCommand(machineCommands()) diff --git a/internal/config/config.go b/internal/config/config.go index c64375d..8ee3cbe 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -36,7 +36,6 @@ const ( httpsListenAddrKey = "IONSCALE_HTTPS_LISTEN_ADDR" serverUrlKey = "IONSCALE_SERVER_URL" keysSystemAdminKeyKey = "IONSCALE_SYSTEM_ADMIN_KEY" - keysEncryptionKeyKey = "IONSCALE_ENCRYPTION_KEY" databaseUrlKey = "IONSCALE_DB_URL" tlsDisableKey = "IONSCALE_TLS_DISABLE" tlsCertFileKey = "IONSCALE_TLS_CERT_FILE" @@ -59,7 +58,6 @@ func defaultConfig() *Config { ServerUrl: GetString(serverUrlKey, "https://localhost:8443"), Keys: Keys{ SystemAdminKey: GetString(keysSystemAdminKeyKey, ""), - EncryptionKey: GetString(keysEncryptionKeyKey, ""), }, Database: Database{ Url: GetString(databaseUrlKey, "ionscale.db"), @@ -73,6 +71,7 @@ func defaultConfig() *Config { CertMagicEmail: GetString(tlsCertMagicEmailKey, ""), CertMagicStoragePath: GetString(tlsCertMagicStoragePath, ""), }, + Provider: Provider{}, Logging: Logging{ Level: GetString(loggingLevelKey, "info"), Format: GetString(loggingFormatKey, ""), @@ -94,6 +93,7 @@ type Config struct { Logging Logging `yaml:"logging,omitempty"` Keys Keys `yaml:"keys,omitempty"` Database Database `yaml:"database,omitempty"` + Provider Provider `yaml:"oidc,omitempty"` } type Tls struct { @@ -118,7 +118,13 @@ type Database struct { type Keys struct { SystemAdminKey string `yaml:"system_admin_key,omitempty"` - EncryptionKey string `yaml:"encryption_key,omitempty"` +} + +type Provider struct { + Issuer string `yaml:"issuer"` + ClientID string `yaml:"client_id"` + ClientSecret string `yaml:"client_secret"` + Scopes []string `yaml:"additional_scopes"` } func (c *Config) CreateUrl(format string, a ...interface{}) string { diff --git a/internal/database/database.go b/internal/database/database.go index 51f1158..d70567e 100644 --- a/internal/database/database.go +++ b/internal/database/database.go @@ -44,7 +44,6 @@ func migrate(db *gorm.DB, repository domain.Repository) error { err := db.AutoMigrate( &domain.ServerConfig{}, &domain.Tailnet{}, - &domain.AuthMethod{}, &domain.Account{}, &domain.User{}, &domain.ApiKey{}, diff --git a/internal/domain/account.go b/internal/domain/account.go index 17853a7..2d2844b 100644 --- a/internal/domain/account.go +++ b/internal/domain/account.go @@ -8,20 +8,17 @@ import ( ) type Account struct { - ID uint64 `gorm:"primary_key;autoIncrement:false"` - - ExternalID string - LoginName string - AuthMethodID uint64 - AuthMethod AuthMethod + ID uint64 `gorm:"primary_key;autoIncrement:false"` + ExternalID string + LoginName string } -func (r *repository) GetOrCreateAccount(ctx context.Context, authMethodID uint64, externalID, loginName string) (*Account, bool, error) { +func (r *repository) GetOrCreateAccount(ctx context.Context, externalID, loginName string) (*Account, bool, error) { account := &Account{} id := util.NextID() tx := r.withContext(ctx). - Where(Account{AuthMethodID: authMethodID, ExternalID: externalID}). + Where(Account{ExternalID: externalID}). Attrs(Account{ID: id, LoginName: loginName}). FirstOrCreate(account) @@ -46,14 +43,3 @@ func (r *repository) GetAccount(ctx context.Context, id uint64) (*Account, error return &account, nil } - -func (r *repository) DeleteAccountsByAuthMethod(ctx context.Context, authMethodID uint64) (int64, error) { - tx := r.withContext(ctx). - Delete(&Account{}, "auth_method_id = ?", authMethodID) - - if tx.Error != nil { - return 0, tx.Error - } - - return tx.RowsAffected, nil -} diff --git a/internal/domain/api_key.go b/internal/domain/api_key.go index 3a40470..252d32b 100644 --- a/internal/domain/api_key.go +++ b/internal/domain/api_key.go @@ -85,20 +85,3 @@ func (r *repository) LoadApiKey(ctx context.Context, key string) (*ApiKey, error return &m, nil } - -func (r *repository) DeleteApiKeysByAuthMethod(ctx context.Context, authMethodID uint64) (int64, error) { - subQuery := r.withContext(ctx). - Select("api_keys.id"). - Table("api_keys"). - Joins("JOIN users u on u.id = api_keys.user_id JOIN accounts a on a.id = u.account_id"). - Where("a.auth_method_id = ?", authMethodID) - - tx := r.withContext(ctx). - Delete(&ApiKey{}, "id in (?)", subQuery) - - if tx.Error != nil { - return 0, tx.Error - } - - return tx.RowsAffected, nil -} diff --git a/internal/domain/auth_key.go b/internal/domain/auth_key.go index 1c6815f..bab30ce 100644 --- a/internal/domain/auth_key.go +++ b/internal/domain/auth_key.go @@ -146,20 +146,3 @@ func (r *repository) LoadAuthKey(ctx context.Context, key string) (*AuthKey, err return &m, nil } - -func (r *repository) DeleteAuthKeysByAuthMethod(ctx context.Context, authMethodID uint64) (int64, error) { - subQuery := r.withContext(ctx). - Select("auth_keys.id"). - Table("auth_keys"). - Joins("JOIN users u on u.id = auth_keys.user_id JOIN accounts a on a.id = u.account_id"). - Where("a.auth_method_id = ?", authMethodID) - - tx := r.withContext(ctx). - Delete(&AuthKey{}, "id in (?)", subQuery) - - if tx.Error != nil { - return 0, tx.Error - } - - return tx.RowsAffected, nil -} diff --git a/internal/domain/auth_method.go b/internal/domain/auth_method.go deleted file mode 100644 index 184be00..0000000 --- a/internal/domain/auth_method.go +++ /dev/null @@ -1,55 +0,0 @@ -package domain - -import ( - "context" - "errors" - "gorm.io/gorm" -) - -type AuthMethod struct { - ID uint64 `gorm:"primary_key;autoIncrement:false"` - Name string `gorm:"type:varchar(64);unique_index"` - Type string - Issuer string - ClientId string - ClientSecret string -} - -func (r *repository) SaveAuthMethod(ctx context.Context, m *AuthMethod) error { - tx := r.withContext(ctx).Save(m) - - if tx.Error != nil { - return tx.Error - } - - return nil -} - -func (r *repository) ListAuthMethods(ctx context.Context) ([]AuthMethod, error) { - var authMethods = []AuthMethod{} - tx := r.withContext(ctx).Find(&authMethods) - if tx.Error != nil { - return nil, tx.Error - } - return authMethods, nil -} - -func (r *repository) GetAuthMethod(ctx context.Context, id uint64) (*AuthMethod, error) { - var m AuthMethod - tx := r.withContext(ctx).First(&m, "id = ?", id) - - if errors.Is(tx.Error, gorm.ErrRecordNotFound) { - return nil, nil - } - - if tx.Error != nil { - return nil, tx.Error - } - - return &m, nil -} - -func (r *repository) DeleteAuthMethod(ctx context.Context, id uint64) error { - tx := r.withContext(ctx).Delete(&AuthMethod{ID: id}) - return tx.Error -} diff --git a/internal/domain/machine.go b/internal/domain/machine.go index be96c10..b72502b 100644 --- a/internal/domain/machine.go +++ b/internal/domain/machine.go @@ -375,58 +375,3 @@ func (r *repository) SetMachineLastSeen(ctx context.Context, machineID uint64) e return nil } - -func (r *repository) CountMachinesByAuthMethod(ctx context.Context, authMethodID uint64) (int64, error) { - var count int64 - - tx := r.withContext(ctx). - Select("machines.id"). - Table("machines"). - Joins("JOIN users u on u.id = machines.user_id JOIN accounts a on a.id = u.account_id"). - Where("a.auth_method_id = ?", authMethodID). - Count(&count) - - if tx.Error != nil { - return 0, tx.Error - } - - return count, nil -} - -func (r *repository) ExpireMachineByAuthMethod(ctx context.Context, tailnetID, authMethodID uint64) (int64, error) { - now := time.Now().UTC() - - subQuery := r.withContext(ctx). - Select("machines.id"). - Table("machines"). - Joins("JOIN users u on u.id = machines.user_id JOIN accounts a on a.id = u.account_id"). - Where("machines.tailnet_id = ? AND a.auth_method_id = ?", tailnetID, authMethodID) - - tx := r.withContext(ctx). - Table("machines"). - Where("tags = '' AND (expires_at is null or expires_at > ?) AND id in (?)", &now, subQuery). - Updates(map[string]interface{}{"expires_at": &now}) - - if tx.Error != nil { - return 0, tx.Error - } - - return tx.RowsAffected, nil -} - -func (r *repository) DeleteMachinesByAuthMethod(ctx context.Context, authMethodID uint64) (int64, error) { - subQuery := r.withContext(ctx). - Select("machines.id"). - Table("machines"). - Joins("JOIN users u on u.id = machines.user_id JOIN accounts a on a.id = u.account_id"). - Where("a.auth_method_id = ?", authMethodID) - - tx := r.withContext(ctx). - Delete(&Machine{}, "id in (?)", subQuery) - - if tx.Error != nil { - return 0, tx.Error - } - - return tx.RowsAffected, nil -} diff --git a/internal/domain/repository.go b/internal/domain/repository.go index 98f843c..21f6f6b 100644 --- a/internal/domain/repository.go +++ b/internal/domain/repository.go @@ -14,14 +14,8 @@ type Repository interface { GetDERPMap(ctx context.Context) (*tailcfg.DERPMap, error) SetDERPMap(ctx context.Context, v *tailcfg.DERPMap) error - SaveAuthMethod(ctx context.Context, m *AuthMethod) error - ListAuthMethods(ctx context.Context) ([]AuthMethod, error) - GetAuthMethod(ctx context.Context, id uint64) (*AuthMethod, error) - DeleteAuthMethod(ctx context.Context, id uint64) error - GetAccount(ctx context.Context, accountID uint64) (*Account, error) - GetOrCreateAccount(ctx context.Context, authMethodID uint64, externalID, loginName string) (*Account, bool, error) - DeleteAccountsByAuthMethod(ctx context.Context, authMethodID uint64) (int64, error) + GetOrCreateAccount(ctx context.Context, externalID, loginName string) (*Account, bool, error) SaveTailnet(ctx context.Context, tailnet *Tailnet) error GetOrCreateTailnet(ctx context.Context, name string) (*Tailnet, bool, error) @@ -31,7 +25,6 @@ type Repository interface { SaveApiKey(ctx context.Context, key *ApiKey) error LoadApiKey(ctx context.Context, key string) (*ApiKey, error) - DeleteApiKeysByAuthMethod(ctx context.Context, authMethodID uint64) (int64, error) GetAuthKey(ctx context.Context, id uint64) (*AuthKey, error) SaveAuthKey(ctx context.Context, key *AuthKey) error @@ -40,13 +33,11 @@ type Repository interface { ListAuthKeys(ctx context.Context, tailnetID uint64) ([]AuthKey, error) ListAuthKeysByTailnetAndUser(ctx context.Context, tailnetID, userID uint64) ([]AuthKey, error) LoadAuthKey(ctx context.Context, key string) (*AuthKey, error) - DeleteAuthKeysByAuthMethod(ctx context.Context, authMethodID uint64) (int64, error) GetOrCreateServiceUser(ctx context.Context, tailnet *Tailnet) (*User, bool, error) ListUsers(ctx context.Context, tailnetID uint64) (Users, error) GetOrCreateUserWithAccount(ctx context.Context, tailnet *Tailnet, account *Account) (*User, bool, error) DeleteUsersByTailnet(ctx context.Context, tailnetID uint64) error - DeleteUsersByAuthMethod(ctx context.Context, authMethodID uint64) (int64, error) SaveMachine(ctx context.Context, m *Machine) error DeleteMachine(ctx context.Context, id uint64) (bool, error) @@ -61,9 +52,6 @@ type Repository interface { ListMachinePeers(ctx context.Context, tailnetID uint64, key string) (Machines, error) ListInactiveEphemeralMachines(ctx context.Context, checkpoint time.Time) (Machines, error) SetMachineLastSeen(ctx context.Context, machineID uint64) error - ExpireMachineByAuthMethod(ctx context.Context, tailnetID, authMethodID uint64) (int64, error) - DeleteMachinesByAuthMethod(ctx context.Context, authMethodID uint64) (int64, error) - CountMachinesByAuthMethod(ctx context.Context, authMethodID uint64) (int64, error) SaveRegistrationRequest(ctx context.Context, request *RegistrationRequest) error GetRegistrationRequestByKey(ctx context.Context, key string) (*RegistrationRequest, error) diff --git a/internal/domain/user.go b/internal/domain/user.go index 7e48a13..a3fd552 100644 --- a/internal/domain/user.go +++ b/internal/domain/user.go @@ -95,20 +95,3 @@ func (r *repository) GetOrCreateUserWithAccount(ctx context.Context, tailnet *Ta return user, user.ID == id, nil } - -func (r *repository) DeleteUsersByAuthMethod(ctx context.Context, authMethodID uint64) (int64, error) { - subQuery := r.withContext(ctx). - Select("users.id"). - Table("users"). - Joins("JOIN accounts a on a.id = users.account_id"). - Where("a.auth_method_id = ?", authMethodID) - - tx := r.withContext(ctx). - Delete(&User{}, "id in (?)", subQuery) - - if tx.Error != nil { - return 0, tx.Error - } - - return tx.RowsAffected, nil -} diff --git a/internal/handlers/authentication.go b/internal/handlers/authentication.go index 9ab3715..ee3df62 100644 --- a/internal/handlers/authentication.go +++ b/internal/handlers/authentication.go @@ -21,9 +21,11 @@ import ( func NewAuthenticationHandlers( config *config.Config, + authProvider provider.AuthProvider, repository domain.Repository) *AuthenticationHandlers { return &AuthenticationHandlers{ config: config, + authProvider: authProvider, repository: repository, pendingOAuthUsers: cache.New(5*time.Minute, 10*time.Minute), } @@ -31,12 +33,13 @@ func NewAuthenticationHandlers( type AuthenticationHandlers struct { repository domain.Repository + authProvider provider.AuthProvider config *config.Config pendingOAuthUsers *cache.Cache } type AuthFormData struct { - AuthMethods []domain.AuthMethod + ProviderAvailable bool } type TailnetSelectionData struct { @@ -44,9 +47,8 @@ type TailnetSelectionData struct { } type oauthState struct { - Key string - Flow string - AuthMethod uint64 + Key string + Flow string } func (h *AuthenticationHandlers) StartCliAuth(c echo.Context) error { @@ -57,52 +59,18 @@ func (h *AuthenticationHandlers) StartCliAuth(c echo.Context) error { return c.Redirect(http.StatusFound, "/a/error") } - methods, err := h.repository.ListAuthMethods(ctx) + if h.authProvider == nil { + return c.Redirect(http.StatusFound, "/a/error") + } + + state, err := h.createState("c", key) if err != nil { return err } - return c.Render(http.StatusOK, "cli_auth.html", &AuthFormData{AuthMethods: methods}) -} + redirectUrl := h.authProvider.GetLoginURL(h.config.CreateUrl("/a/callback"), state) -func (h *AuthenticationHandlers) ProcessCliAuth(c echo.Context) error { - ctx := c.Request().Context() - - key := c.Param("key") - authMethodId := c.FormValue("s") - - req, err := h.repository.GetAuthenticationRequest(ctx, key) - if err != nil || req == nil { - return c.Redirect(http.StatusFound, "/a/error") - } - - if authMethodId != "" { - id, err := strconv.ParseUint(authMethodId, 10, 64) - if err != nil { - return err - } - - method, err := h.repository.GetAuthMethod(ctx, id) - if err != nil { - return err - } - - state, err := h.createState("c", key, method.ID) - if err != nil { - return err - } - - authProvider, err := provider.NewProvider(method) - if err != nil { - return err - } - - redirectUrl := authProvider.GetLoginURL(h.config.CreateUrl("/a/callback"), state) - - return c.Redirect(http.StatusFound, redirectUrl) - } - - return c.Redirect(http.StatusFound, "/a/c/"+key) + return c.Redirect(http.StatusFound, redirectUrl) } func (h *AuthenticationHandlers) StartAuth(c echo.Context) error { @@ -113,12 +81,7 @@ func (h *AuthenticationHandlers) StartAuth(c echo.Context) error { return c.Redirect(http.StatusFound, "/a/error") } - methods, err := h.repository.ListAuthMethods(ctx) - if err != nil { - return err - } - - return c.Render(http.StatusOK, "auth.html", &AuthFormData{AuthMethods: methods}) + return c.Render(http.StatusOK, "auth.html", &AuthFormData{ProviderAvailable: h.authProvider != nil}) } func (h *AuthenticationHandlers) ProcessAuth(c echo.Context) error { @@ -126,7 +89,7 @@ func (h *AuthenticationHandlers) ProcessAuth(c echo.Context) error { key := c.Param("key") authKey := c.FormValue("ak") - authMethodId := c.FormValue("s") + interactive := c.FormValue("s") req, err := h.repository.GetRegistrationRequestByKey(ctx, key) if err != nil || req == nil { @@ -137,28 +100,13 @@ func (h *AuthenticationHandlers) ProcessAuth(c echo.Context) error { return h.endMachineRegistrationFlow(c, req, &oauthState{Key: key}) } - if authMethodId != "" { - id, err := strconv.ParseUint(authMethodId, 10, 64) + if interactive != "" { + state, err := h.createState("r", key) if err != nil { return err } - method, err := h.repository.GetAuthMethod(ctx, id) - if err != nil { - return err - } - - state, err := h.createState("r", key, method.ID) - if err != nil { - return err - } - - authProvider, err := provider.NewProvider(method) - if err != nil { - return err - } - - redirectUrl := authProvider.GetLoginURL(h.config.CreateUrl("/a/callback"), state) + redirectUrl := h.authProvider.GetLoginURL(h.config.CreateUrl("/a/callback"), state) return c.Redirect(http.StatusFound, redirectUrl) } @@ -175,7 +123,7 @@ func (h *AuthenticationHandlers) Callback(c echo.Context) error { return err } - user, err := h.exchangeUser(ctx, code, state) + user, err := h.exchangeUser(code) if err != nil { return err } @@ -202,7 +150,7 @@ func (h *AuthenticationHandlers) Callback(c echo.Context) error { return c.Redirect(http.StatusFound, "/a/error?e=ua") } - account, _, err := h.repository.GetOrCreateAccount(ctx, state.AuthMethod, user.ID, user.Name) + account, _, err := h.repository.GetOrCreateAccount(ctx, user.ID, user.Name) if err != nil { return err } @@ -490,23 +438,10 @@ func (h *AuthenticationHandlers) endMachineRegistrationFlow(c echo.Context, regi return c.Redirect(http.StatusFound, "/a/success") } -func (h *AuthenticationHandlers) getAuthProvider(ctx context.Context, authMethodId uint64) (provider.AuthProvider, error) { - authMethod, err := h.repository.GetAuthMethod(ctx, authMethodId) - if err != nil { - return nil, err - } - return provider.NewProvider(authMethod) -} - -func (h *AuthenticationHandlers) exchangeUser(ctx context.Context, code string, state *oauthState) (*provider.User, error) { +func (h *AuthenticationHandlers) exchangeUser(code string) (*provider.User, error) { redirectUrl := h.config.CreateUrl("/a/callback") - authProvider, err := h.getAuthProvider(ctx, state.AuthMethod) - if err != nil { - return nil, err - } - - user, err := authProvider.Exchange(redirectUrl, code) + user, err := h.authProvider.Exchange(redirectUrl, code) if err != nil { return nil, err } @@ -514,8 +449,8 @@ func (h *AuthenticationHandlers) exchangeUser(ctx context.Context, code string, return user, nil } -func (h *AuthenticationHandlers) createState(flow string, key string, authMethodId uint64) (string, error) { - stateMap := oauthState{Key: key, AuthMethod: authMethodId, Flow: flow} +func (h *AuthenticationHandlers) createState(flow string, key string) (string, error) { + stateMap := oauthState{Key: key, Flow: flow} marshal, err := json.Marshal(&stateMap) if err != nil { return "", err diff --git a/internal/provider/oidc.go b/internal/provider/oidc.go index 616564a..a2c5dbb 100644 --- a/internal/provider/oidc.go +++ b/internal/provider/oidc.go @@ -3,31 +3,34 @@ package provider import ( "context" "fmt" + "github.com/jsiebens/ionscale/internal/config" "strings" "github.com/coreos/go-oidc/v3/oidc" - "github.com/jsiebens/ionscale/internal/domain" "golang.org/x/oauth2" ) type OIDCProvider struct { clientID string clientSecret string + scopes []string provider *oidc.Provider verifier *oidc.IDTokenVerifier } -func NewOIDCProvider(c *domain.AuthMethod) (*OIDCProvider, error) { +func NewOIDCProvider(c *config.Provider) (*OIDCProvider, error) { + defaultScopes := []string{oidc.ScopeOpenID, "email", "profile"} provider, err := oidc.NewProvider(context.Background(), c.Issuer) if err != nil { return nil, err } - verifier := provider.Verifier(&oidc.Config{ClientID: c.ClientId}) + verifier := provider.Verifier(&oidc.Config{ClientID: c.ClientID, SkipClientIDCheck: c.ClientID == ""}) return &OIDCProvider{ - clientID: c.ClientId, + clientID: c.ClientID, clientSecret: c.ClientSecret, + scopes: append(defaultScopes, c.Scopes...), provider: provider, verifier: verifier, }, nil diff --git a/internal/provider/providers.go b/internal/provider/providers.go index 8ec84d8..bb6ecbe 100644 --- a/internal/provider/providers.go +++ b/internal/provider/providers.go @@ -1,11 +1,5 @@ package provider -import ( - "fmt" - - "github.com/jsiebens/ionscale/internal/domain" -) - type AuthProvider interface { GetLoginURL(redirectURI, state string) string Exchange(redirectURI, code string) (*User, error) @@ -16,12 +10,3 @@ type User struct { Name string Attr map[string]interface{} } - -func NewProvider(m *domain.AuthMethod) (AuthProvider, error) { - switch m.Type { - case "oidc": - return NewOIDCProvider(m) - default: - return nil, fmt.Errorf("unknown auth method type") - } -} diff --git a/internal/server/server.go b/internal/server/server.go index f62599f..67c3bbc 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -11,6 +11,7 @@ import ( "github.com/jsiebens/ionscale/internal/config" "github.com/jsiebens/ionscale/internal/database" "github.com/jsiebens/ionscale/internal/handlers" + "github.com/jsiebens/ionscale/internal/provider" "github.com/jsiebens/ionscale/internal/service" "github.com/jsiebens/ionscale/internal/templates" echo_prometheus "github.com/labstack/echo-contrib/prometheus" @@ -26,20 +27,20 @@ import ( "tailscale.com/types/key" ) -func Start(config *config.Config) error { - logger, err := setupLogging(config.Logging) +func Start(c *config.Config) error { + logger, err := setupLogging(c.Logging) if err != nil { return err } logger.Info("Starting ionscale server") - serverKey, err := config.ReadServerKeys() + serverKey, err := c.ReadServerKeys() if err != nil { return err } - _, repository, err := database.OpenDB(&config.Database, logger) + _, repository, err := database.OpenDB(&c.Database, logger) if err != nil { return err } @@ -57,25 +58,25 @@ func Start(config *config.Config) error { go reaper.Start() // prepare CertMagic - if config.Tls.CertMagicDomain != "" { + if c.Tls.CertMagicDomain != "" { certmagic.DefaultACME.Agreed = true - certmagic.DefaultACME.Email = config.Tls.CertMagicEmail - certmagic.DefaultACME.CA = config.Tls.CertMagicCA - if config.Tls.CertMagicStoragePath != "" { - certmagic.Default.Storage = &certmagic.FileStorage{Path: config.Tls.CertMagicStoragePath} + certmagic.DefaultACME.Email = c.Tls.CertMagicEmail + certmagic.DefaultACME.CA = c.Tls.CertMagicCA + if c.Tls.CertMagicStoragePath != "" { + certmagic.Default.Storage = &certmagic.FileStorage{Path: c.Tls.CertMagicStoragePath} } cfg := certmagic.NewDefault() - if err := cfg.ManageAsync(context.Background(), []string{config.Tls.CertMagicDomain}); err != nil { + if err := cfg.ManageAsync(context.Background(), []string{c.Tls.CertMagicDomain}); err != nil { return err } - config.HttpListenAddr = fmt.Sprintf(":%d", certmagic.HTTPPort) - config.HttpsListenAddr = fmt.Sprintf(":%d", certmagic.HTTPSPort) + c.HttpListenAddr = fmt.Sprintf(":%d", certmagic.HTTPPort) + c.HttpsListenAddr = fmt.Sprintf(":%d", certmagic.HTTPSPort) } createPeerHandler := func(p key.MachinePublic) http.Handler { - registrationHandlers := handlers.NewRegistrationHandlers(bind.DefaultBinder(p), config, brokers, repository) + registrationHandlers := handlers.NewRegistrationHandlers(bind.DefaultBinder(p), c, brokers, repository) pollNetMapHandler := handlers.NewPollNetMapHandler(bind.DefaultBinder(p), brokers, repository, offlineTimers) e := echo.New() @@ -87,15 +88,21 @@ func Start(config *config.Config) error { return e } + authProvider, err := setupAuthProvider(c.Provider) + if err != nil { + return err + } + noiseHandlers := handlers.NewNoiseHandlers(controlKeys.ControlKey, createPeerHandler) - registrationHandlers := handlers.NewRegistrationHandlers(bind.BoxBinder(controlKeys.LegacyControlKey), config, brokers, repository) + registrationHandlers := handlers.NewRegistrationHandlers(bind.BoxBinder(controlKeys.LegacyControlKey), c, brokers, repository) pollNetMapHandler := handlers.NewPollNetMapHandler(bind.BoxBinder(controlKeys.LegacyControlKey), brokers, repository, offlineTimers) authenticationHandlers := handlers.NewAuthenticationHandlers( - config, + c, + authProvider, repository, ) - rpcService := service.NewService(config, repository, brokers) + rpcService := service.NewService(c, authProvider, repository, brokers) rpcPath, rpcHandler := NewRpcHandler(serverKey.SystemAdminKey, repository, rpcService) p := echo_prometheus.NewPrometheus("http", nil) @@ -108,7 +115,7 @@ func Start(config *config.Config) error { nonTlsAppHandler.Use(EchoLogger(logger)) nonTlsAppHandler.Use(p.HandlerFunc) nonTlsAppHandler.POST("/ts2021", noiseHandlers.Upgrade) - nonTlsAppHandler.Any("/*", handlers.HttpRedirectHandler(config.Tls)) + nonTlsAppHandler.Any("/*", handlers.HttpRedirectHandler(c.Tls)) tlsAppHandler := echo.New() tlsAppHandler.Renderer = templates.NewTemplates() @@ -129,23 +136,22 @@ func Start(config *config.Config) error { auth.GET("/:key", authenticationHandlers.StartAuth) auth.POST("/:key", authenticationHandlers.ProcessAuth) auth.GET("/c/:key", authenticationHandlers.StartCliAuth) - auth.POST("/c/:key", authenticationHandlers.ProcessCliAuth) auth.GET("/callback", authenticationHandlers.Callback) auth.POST("/callback", authenticationHandlers.EndOAuth) auth.GET("/success", authenticationHandlers.Success) auth.GET("/error", authenticationHandlers.Error) - tlsL, err := tlsListener(config) + tlsL, err := tlsListener(c) if err != nil { return err } - nonTlsL, err := nonTlsListener(config) + nonTlsL, err := nonTlsListener(c) if err != nil { return err } - metricsL, err := metricsListener(config) + metricsL, err := metricsListener(c) if err != nil { return err } @@ -161,20 +167,27 @@ func Start(config *config.Config) error { g.Go(func() error { return http.Serve(nonTlsL, nonTlsAppHandler) }) } - if config.Tls.CertMagicDomain != "" { - logger.Info("TLS is enabled with CertMagic", "domain", config.Tls.CertMagicDomain) - logger.Info("Server is running", "http_addr", config.HttpListenAddr, "https_addr", config.HttpsListenAddr, "metrics_addr", config.MetricsListenAddr) - } else if !config.Tls.Disable { - logger.Info("TLS is enabled", "cert", config.Tls.CertFile) - logger.Info("Server is running", "http_addr", config.HttpListenAddr, "https_addr", config.HttpsListenAddr, "metrics_addr", config.MetricsListenAddr) + if c.Tls.CertMagicDomain != "" { + logger.Info("TLS is enabled with CertMagic", "domain", c.Tls.CertMagicDomain) + logger.Info("Server is running", "http_addr", c.HttpListenAddr, "https_addr", c.HttpsListenAddr, "metrics_addr", c.MetricsListenAddr) + } else if !c.Tls.Disable { + logger.Info("TLS is enabled", "cert", c.Tls.CertFile) + logger.Info("Server is running", "http_addr", c.HttpListenAddr, "https_addr", c.HttpsListenAddr, "metrics_addr", c.MetricsListenAddr) } else { logger.Warn("TLS is disabled") - logger.Info("Server is running", "http_addr", config.HttpListenAddr, "metrics_addr", config.MetricsListenAddr) + logger.Info("Server is running", "http_addr", c.HttpListenAddr, "metrics_addr", c.MetricsListenAddr) } return g.Wait() } +func setupAuthProvider(config config.Provider) (provider.AuthProvider, error) { + if len(config.Issuer) == 0 { + return nil, nil + } + return provider.NewOIDCProvider(&config) +} + func metricsListener(config *config.Config) (net.Listener, error) { return net.Listen("tcp", config.MetricsListenAddr) } diff --git a/internal/service/auth.go b/internal/service/auth.go index 8d8446b..0ab3e47 100644 --- a/internal/service/auth.go +++ b/internal/service/auth.go @@ -11,14 +11,8 @@ import ( ) func (s *Service) Authenticate(ctx context.Context, req *connect.Request[api.AuthenticationRequest], stream *connect.ServerStream[api.AuthenticationResponse]) error { - - methods, err := s.repository.ListAuthMethods(ctx) - if err != nil { - return err - } - - if len(methods) == 0 { - return connect.NewError(connect.CodeFailedPrecondition, errors.New("no auth methods available, contact your ionscale administrator for more information")) + if s.authProvider == nil { + return connect.NewError(connect.CodeFailedPrecondition, errors.New("no authentication method available, contact your ionscale administrator for more information")) } key := util.RandStringBytes(8) diff --git a/internal/service/auth_method.go b/internal/service/auth_method.go deleted file mode 100644 index 545fd8d..0000000 --- a/internal/service/auth_method.go +++ /dev/null @@ -1,142 +0,0 @@ -package service - -import ( - "context" - "errors" - "fmt" - "github.com/bufbuild/connect-go" - "github.com/jsiebens/ionscale/internal/domain" - "github.com/jsiebens/ionscale/internal/util" - api "github.com/jsiebens/ionscale/pkg/gen/ionscale/v1" -) - -func (s *Service) GetAuthMethod(ctx context.Context, req *connect.Request[api.GetAuthMethodRequest]) (*connect.Response[api.GetAuthMethodResponse], error) { - principal := CurrentPrincipal(ctx) - if !principal.IsSystemAdmin() { - return nil, connect.NewError(connect.CodePermissionDenied, errors.New("permission denied")) - } - - authMethod, err := s.repository.GetAuthMethod(ctx, req.Msg.AuthMethodId) - if err != nil { - return nil, err - } - - if authMethod == nil { - return nil, connect.NewError(connect.CodeNotFound, errors.New("tailnet not found")) - } - - return connect.NewResponse(&api.GetAuthMethodResponse{AuthMethod: &api.AuthMethod{ - Id: authMethod.ID, - Type: authMethod.Type, - Name: authMethod.Name, - Issuer: authMethod.Issuer, - ClientId: authMethod.ClientId, - ClientSecret: authMethod.ClientSecret, - }}), nil -} - -func (s *Service) CreateAuthMethod(ctx context.Context, req *connect.Request[api.CreateAuthMethodRequest]) (*connect.Response[api.CreateAuthMethodResponse], error) { - principal := CurrentPrincipal(ctx) - if !principal.IsSystemAdmin() { - return nil, connect.NewError(connect.CodePermissionDenied, errors.New("permission denied")) - } - - authMethod := &domain.AuthMethod{ - ID: util.NextID(), - Name: req.Msg.Name, - Type: req.Msg.Type, - Issuer: req.Msg.Issuer, - ClientId: req.Msg.ClientId, - ClientSecret: req.Msg.ClientSecret, - } - - if err := s.repository.SaveAuthMethod(ctx, authMethod); err != nil { - return nil, err - } - - return connect.NewResponse(&api.CreateAuthMethodResponse{AuthMethod: &api.AuthMethod{ - Id: authMethod.ID, - Type: authMethod.Type, - Name: authMethod.Name, - Issuer: authMethod.Issuer, - ClientId: authMethod.ClientId, - ClientSecret: authMethod.ClientSecret, - }}), nil - -} - -func (s *Service) ListAuthMethods(ctx context.Context, _ *connect.Request[api.ListAuthMethodsRequest]) (*connect.Response[api.ListAuthMethodsResponse], error) { - principal := CurrentPrincipal(ctx) - if !principal.IsSystemAdmin() { - return nil, connect.NewError(connect.CodePermissionDenied, errors.New("permission denied")) - } - - methods, err := s.repository.ListAuthMethods(ctx) - if err != nil { - return nil, err - } - - response := &api.ListAuthMethodsResponse{AuthMethods: []*api.AuthMethod{}} - for _, m := range methods { - response.AuthMethods = append(response.AuthMethods, &api.AuthMethod{ - Id: m.ID, - Name: m.Name, - Type: m.Type, - }) - } - - return connect.NewResponse(response), nil -} - -func (s *Service) DeleteAuthMethod(ctx context.Context, req *connect.Request[api.DeleteAuthMethodRequest]) (*connect.Response[api.DeleteAuthMethodResponse], error) { - principal := CurrentPrincipal(ctx) - if !principal.IsSystemAdmin() { - return nil, connect.NewError(connect.CodePermissionDenied, errors.New("permission denied")) - } - - count, err := s.repository.CountMachinesByAuthMethod(ctx, req.Msg.AuthMethodId) - if err != nil { - return nil, err - } - - if !req.Msg.Force && count > 0 { - return nil, connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("there are still machines authenticated using this method, number of machines: %d", count)) - } - - err = s.repository.Transaction(func(rp domain.Repository) error { - - if _, err := rp.DeleteMachinesByAuthMethod(ctx, req.Msg.AuthMethodId); err != nil { - return err - } - - if _, err := rp.DeleteAuthKeysByAuthMethod(ctx, req.Msg.AuthMethodId); err != nil { - return err - } - - if _, err := rp.DeleteApiKeysByAuthMethod(ctx, req.Msg.AuthMethodId); err != nil { - return err - } - - if _, err := rp.DeleteUsersByAuthMethod(ctx, req.Msg.AuthMethodId); err != nil { - return err - } - - if _, err := rp.DeleteAccountsByAuthMethod(ctx, req.Msg.AuthMethodId); err != nil { - return err - } - - if err := rp.DeleteAuthMethod(ctx, req.Msg.AuthMethodId); err != nil { - return err - } - - return nil - }) - - if err != nil { - return nil, err - } - - s.brokerPool.SignalUpdate() - - return connect.NewResponse(&api.DeleteAuthMethodResponse{}), nil -} diff --git a/internal/service/service.go b/internal/service/service.go index a6c784c..a026720 100644 --- a/internal/service/service.go +++ b/internal/service/service.go @@ -6,22 +6,25 @@ import ( "github.com/jsiebens/ionscale/internal/broker" "github.com/jsiebens/ionscale/internal/config" "github.com/jsiebens/ionscale/internal/domain" + "github.com/jsiebens/ionscale/internal/provider" "github.com/jsiebens/ionscale/internal/version" api "github.com/jsiebens/ionscale/pkg/gen/ionscale/v1" ) -func NewService(config *config.Config, repository domain.Repository, brokerPool *broker.BrokerPool) *Service { +func NewService(config *config.Config, authProvider provider.AuthProvider, repository domain.Repository, brokerPool *broker.BrokerPool) *Service { return &Service{ - config: config, - repository: repository, - brokerPool: brokerPool, + config: config, + authProvider: authProvider, + repository: repository, + brokerPool: brokerPool, } } type Service struct { - config *config.Config - repository domain.Repository - brokerPool *broker.BrokerPool + config *config.Config + authProvider provider.AuthProvider + repository domain.Repository + brokerPool *broker.BrokerPool } func (s *Service) brokers(tailnetID uint64) broker.Broker { diff --git a/internal/templates/auth.html b/internal/templates/auth.html index 10fa95c..e721894 100644 --- a/internal/templates/auth.html +++ b/internal/templates/auth.html @@ -74,23 +74,21 @@
- {{if .AuthMethods}} + {{if .ProviderAvailable}}

Authentication required

Login with:
    - {{range .AuthMethods}} -
  • - {{end}} +
Or enter an here:
{{end}} - {{if not .AuthMethods}} + {{if not .ProviderAvailable}}

Authentication required

Enter an here: diff --git a/internal/templates/cli_auth.html b/internal/templates/cli_auth.html index 7a5de39..0b4631f 100644 --- a/internal/templates/cli_auth.html +++ b/internal/templates/cli_auth.html @@ -74,22 +74,20 @@
- {{if .AuthMethods}} + {{if .ProviderAvailable}}

Authentication required

Login with:
    - {{range .AuthMethods}} -
  • - {{end}} +
{{end}} - {{if not .AuthMethods}} + {{if not .ProviderAvailable}}
-

No auth methods available.

+

No authentication method available.

contact your ionscale administrator for more information
{{end}} diff --git a/pkg/gen/ionscale/v1/auth_filter.pb.go b/pkg/gen/ionscale/v1/auth_filter.pb.go deleted file mode 100644 index 14f52cc..0000000 --- a/pkg/gen/ionscale/v1/auth_filter.pb.go +++ /dev/null @@ -1,582 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc (unknown) -// source: ionscale/v1/auth_filter.proto - -package ionscalev1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AuthFilter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - AuthMethod *Ref `protobuf:"bytes,2,opt,name=auth_method,json=authMethod,proto3" json:"auth_method,omitempty"` - Tailnet *Ref `protobuf:"bytes,3,opt,name=tailnet,proto3" json:"tailnet,omitempty"` - Expr string `protobuf:"bytes,4,opt,name=expr,proto3" json:"expr,omitempty"` -} - -func (x *AuthFilter) Reset() { - *x = AuthFilter{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AuthFilter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthFilter) ProtoMessage() {} - -func (x *AuthFilter) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthFilter.ProtoReflect.Descriptor instead. -func (*AuthFilter) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_filter_proto_rawDescGZIP(), []int{0} -} - -func (x *AuthFilter) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *AuthFilter) GetAuthMethod() *Ref { - if x != nil { - return x.AuthMethod - } - return nil -} - -func (x *AuthFilter) GetTailnet() *Ref { - if x != nil { - return x.Tailnet - } - return nil -} - -func (x *AuthFilter) GetExpr() string { - if x != nil { - return x.Expr - } - return "" -} - -type CreateAuthFilterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AuthMethodId uint64 `protobuf:"varint,1,opt,name=auth_method_id,json=authMethodId,proto3" json:"auth_method_id,omitempty"` - TailnetId uint64 `protobuf:"varint,2,opt,name=tailnet_id,json=tailnetId,proto3" json:"tailnet_id,omitempty"` - Expr string `protobuf:"bytes,3,opt,name=expr,proto3" json:"expr,omitempty"` -} - -func (x *CreateAuthFilterRequest) Reset() { - *x = CreateAuthFilterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateAuthFilterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAuthFilterRequest) ProtoMessage() {} - -func (x *CreateAuthFilterRequest) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateAuthFilterRequest.ProtoReflect.Descriptor instead. -func (*CreateAuthFilterRequest) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_filter_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateAuthFilterRequest) GetAuthMethodId() uint64 { - if x != nil { - return x.AuthMethodId - } - return 0 -} - -func (x *CreateAuthFilterRequest) GetTailnetId() uint64 { - if x != nil { - return x.TailnetId - } - return 0 -} - -func (x *CreateAuthFilterRequest) GetExpr() string { - if x != nil { - return x.Expr - } - return "" -} - -type CreateAuthFilterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AuthFilter *AuthFilter `protobuf:"bytes,1,opt,name=auth_filter,json=authFilter,proto3" json:"auth_filter,omitempty"` -} - -func (x *CreateAuthFilterResponse) Reset() { - *x = CreateAuthFilterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateAuthFilterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAuthFilterResponse) ProtoMessage() {} - -func (x *CreateAuthFilterResponse) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateAuthFilterResponse.ProtoReflect.Descriptor instead. -func (*CreateAuthFilterResponse) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_filter_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateAuthFilterResponse) GetAuthFilter() *AuthFilter { - if x != nil { - return x.AuthFilter - } - return nil -} - -type ListAuthFiltersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AuthMethodId *uint64 `protobuf:"varint,1,opt,name=auth_method_id,json=authMethodId,proto3,oneof" json:"auth_method_id,omitempty"` -} - -func (x *ListAuthFiltersRequest) Reset() { - *x = ListAuthFiltersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAuthFiltersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAuthFiltersRequest) ProtoMessage() {} - -func (x *ListAuthFiltersRequest) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAuthFiltersRequest.ProtoReflect.Descriptor instead. -func (*ListAuthFiltersRequest) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_filter_proto_rawDescGZIP(), []int{3} -} - -func (x *ListAuthFiltersRequest) GetAuthMethodId() uint64 { - if x != nil && x.AuthMethodId != nil { - return *x.AuthMethodId - } - return 0 -} - -type ListAuthFiltersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AuthFilters []*AuthFilter `protobuf:"bytes,1,rep,name=auth_filters,json=authFilters,proto3" json:"auth_filters,omitempty"` -} - -func (x *ListAuthFiltersResponse) Reset() { - *x = ListAuthFiltersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAuthFiltersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAuthFiltersResponse) ProtoMessage() {} - -func (x *ListAuthFiltersResponse) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAuthFiltersResponse.ProtoReflect.Descriptor instead. -func (*ListAuthFiltersResponse) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_filter_proto_rawDescGZIP(), []int{4} -} - -func (x *ListAuthFiltersResponse) GetAuthFilters() []*AuthFilter { - if x != nil { - return x.AuthFilters - } - return nil -} - -type DeleteAuthFilterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AuthFilterId uint64 `protobuf:"varint,1,opt,name=auth_filter_id,json=authFilterId,proto3" json:"auth_filter_id,omitempty"` -} - -func (x *DeleteAuthFilterRequest) Reset() { - *x = DeleteAuthFilterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteAuthFilterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAuthFilterRequest) ProtoMessage() {} - -func (x *DeleteAuthFilterRequest) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteAuthFilterRequest.ProtoReflect.Descriptor instead. -func (*DeleteAuthFilterRequest) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_filter_proto_rawDescGZIP(), []int{5} -} - -func (x *DeleteAuthFilterRequest) GetAuthFilterId() uint64 { - if x != nil { - return x.AuthFilterId - } - return 0 -} - -type DeleteAuthFilterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteAuthFilterResponse) Reset() { - *x = DeleteAuthFilterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteAuthFilterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAuthFilterResponse) ProtoMessage() {} - -func (x *DeleteAuthFilterResponse) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_filter_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteAuthFilterResponse.ProtoReflect.Descriptor instead. -func (*DeleteAuthFilterResponse) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_filter_proto_rawDescGZIP(), []int{6} -} - -var File_ionscale_v1_auth_filter_proto protoreflect.FileDescriptor - -var file_ionscale_v1_auth_filter_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, - 0x74, 0x68, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x0b, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x15, 0x69, 0x6f, - 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x66, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x8f, 0x01, 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x46, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x31, 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, - 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x66, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2a, 0x0a, 0x07, 0x74, 0x61, 0x69, 0x6c, 0x6e, 0x65, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x66, 0x52, 0x07, 0x74, 0x61, 0x69, 0x6c, 0x6e, 0x65, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x78, 0x70, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x65, 0x78, 0x70, 0x72, 0x22, 0x72, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, - 0x75, 0x74, 0x68, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x69, 0x6c, 0x6e, 0x65, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x61, 0x69, 0x6c, - 0x6e, 0x65, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x78, 0x70, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x78, 0x70, 0x72, 0x22, 0x54, 0x0a, 0x18, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x6f, 0x6e, - 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x46, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, - 0x56, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x46, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x0e, 0x61, 0x75, 0x74, - 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, - 0x64, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x22, 0x55, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x75, 0x74, 0x68, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x6f, 0x6e, 0x73, 0x63, - 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x46, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x52, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x3f, - 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x46, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x75, 0x74, - 0x68, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, - 0x1a, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x46, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3d, 0x5a, 0x3b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6a, 0x73, 0x69, 0x65, 0x62, 0x65, - 0x6e, 0x73, 0x2f, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, - 0x67, 0x65, 0x6e, 0x2f, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, - 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_ionscale_v1_auth_filter_proto_rawDescOnce sync.Once - file_ionscale_v1_auth_filter_proto_rawDescData = file_ionscale_v1_auth_filter_proto_rawDesc -) - -func file_ionscale_v1_auth_filter_proto_rawDescGZIP() []byte { - file_ionscale_v1_auth_filter_proto_rawDescOnce.Do(func() { - file_ionscale_v1_auth_filter_proto_rawDescData = protoimpl.X.CompressGZIP(file_ionscale_v1_auth_filter_proto_rawDescData) - }) - return file_ionscale_v1_auth_filter_proto_rawDescData -} - -var file_ionscale_v1_auth_filter_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_ionscale_v1_auth_filter_proto_goTypes = []interface{}{ - (*AuthFilter)(nil), // 0: ionscale.v1.AuthFilter - (*CreateAuthFilterRequest)(nil), // 1: ionscale.v1.CreateAuthFilterRequest - (*CreateAuthFilterResponse)(nil), // 2: ionscale.v1.CreateAuthFilterResponse - (*ListAuthFiltersRequest)(nil), // 3: ionscale.v1.ListAuthFiltersRequest - (*ListAuthFiltersResponse)(nil), // 4: ionscale.v1.ListAuthFiltersResponse - (*DeleteAuthFilterRequest)(nil), // 5: ionscale.v1.DeleteAuthFilterRequest - (*DeleteAuthFilterResponse)(nil), // 6: ionscale.v1.DeleteAuthFilterResponse - (*Ref)(nil), // 7: ionscale.v1.Ref -} -var file_ionscale_v1_auth_filter_proto_depIdxs = []int32{ - 7, // 0: ionscale.v1.AuthFilter.auth_method:type_name -> ionscale.v1.Ref - 7, // 1: ionscale.v1.AuthFilter.tailnet:type_name -> ionscale.v1.Ref - 0, // 2: ionscale.v1.CreateAuthFilterResponse.auth_filter:type_name -> ionscale.v1.AuthFilter - 0, // 3: ionscale.v1.ListAuthFiltersResponse.auth_filters:type_name -> ionscale.v1.AuthFilter - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_ionscale_v1_auth_filter_proto_init() } -func file_ionscale_v1_auth_filter_proto_init() { - if File_ionscale_v1_auth_filter_proto != nil { - return - } - file_ionscale_v1_ref_proto_init() - if !protoimpl.UnsafeEnabled { - file_ionscale_v1_auth_filter_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthFilter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_filter_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAuthFilterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_filter_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAuthFilterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_filter_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAuthFiltersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_filter_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAuthFiltersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_filter_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteAuthFilterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_filter_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteAuthFilterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_ionscale_v1_auth_filter_proto_msgTypes[3].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_ionscale_v1_auth_filter_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_ionscale_v1_auth_filter_proto_goTypes, - DependencyIndexes: file_ionscale_v1_auth_filter_proto_depIdxs, - MessageInfos: file_ionscale_v1_auth_filter_proto_msgTypes, - }.Build() - File_ionscale_v1_auth_filter_proto = out.File - file_ionscale_v1_auth_filter_proto_rawDesc = nil - file_ionscale_v1_auth_filter_proto_goTypes = nil - file_ionscale_v1_auth_filter_proto_depIdxs = nil -} diff --git a/pkg/gen/ionscale/v1/auth_methods.pb.go b/pkg/gen/ionscale/v1/auth_methods.pb.go deleted file mode 100644 index b32c6e5..0000000 --- a/pkg/gen/ionscale/v1/auth_methods.pb.go +++ /dev/null @@ -1,737 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc (unknown) -// source: ionscale/v1/auth_methods.proto - -package ionscalev1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AuthMethod struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Issuer string `protobuf:"bytes,4,opt,name=issuer,proto3" json:"issuer,omitempty"` - ClientId string `protobuf:"bytes,5,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - ClientSecret string `protobuf:"bytes,6,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` -} - -func (x *AuthMethod) Reset() { - *x = AuthMethod{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AuthMethod) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthMethod) ProtoMessage() {} - -func (x *AuthMethod) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthMethod.ProtoReflect.Descriptor instead. -func (*AuthMethod) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_methods_proto_rawDescGZIP(), []int{0} -} - -func (x *AuthMethod) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *AuthMethod) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *AuthMethod) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *AuthMethod) GetIssuer() string { - if x != nil { - return x.Issuer - } - return "" -} - -func (x *AuthMethod) GetClientId() string { - if x != nil { - return x.ClientId - } - return "" -} - -func (x *AuthMethod) GetClientSecret() string { - if x != nil { - return x.ClientSecret - } - return "" -} - -type GetAuthMethodRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AuthMethodId uint64 `protobuf:"varint,1,opt,name=auth_method_id,json=authMethodId,proto3" json:"auth_method_id,omitempty"` -} - -func (x *GetAuthMethodRequest) Reset() { - *x = GetAuthMethodRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetAuthMethodRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAuthMethodRequest) ProtoMessage() {} - -func (x *GetAuthMethodRequest) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetAuthMethodRequest.ProtoReflect.Descriptor instead. -func (*GetAuthMethodRequest) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_methods_proto_rawDescGZIP(), []int{1} -} - -func (x *GetAuthMethodRequest) GetAuthMethodId() uint64 { - if x != nil { - return x.AuthMethodId - } - return 0 -} - -type GetAuthMethodResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AuthMethod *AuthMethod `protobuf:"bytes,1,opt,name=auth_method,json=authMethod,proto3" json:"auth_method,omitempty"` -} - -func (x *GetAuthMethodResponse) Reset() { - *x = GetAuthMethodResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetAuthMethodResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAuthMethodResponse) ProtoMessage() {} - -func (x *GetAuthMethodResponse) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetAuthMethodResponse.ProtoReflect.Descriptor instead. -func (*GetAuthMethodResponse) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_methods_proto_rawDescGZIP(), []int{2} -} - -func (x *GetAuthMethodResponse) GetAuthMethod() *AuthMethod { - if x != nil { - return x.AuthMethod - } - return nil -} - -type CreateAuthMethodRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Issuer string `protobuf:"bytes,3,opt,name=issuer,proto3" json:"issuer,omitempty"` - ClientId string `protobuf:"bytes,4,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - ClientSecret string `protobuf:"bytes,5,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` -} - -func (x *CreateAuthMethodRequest) Reset() { - *x = CreateAuthMethodRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateAuthMethodRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAuthMethodRequest) ProtoMessage() {} - -func (x *CreateAuthMethodRequest) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateAuthMethodRequest.ProtoReflect.Descriptor instead. -func (*CreateAuthMethodRequest) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_methods_proto_rawDescGZIP(), []int{3} -} - -func (x *CreateAuthMethodRequest) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *CreateAuthMethodRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateAuthMethodRequest) GetIssuer() string { - if x != nil { - return x.Issuer - } - return "" -} - -func (x *CreateAuthMethodRequest) GetClientId() string { - if x != nil { - return x.ClientId - } - return "" -} - -func (x *CreateAuthMethodRequest) GetClientSecret() string { - if x != nil { - return x.ClientSecret - } - return "" -} - -type CreateAuthMethodResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AuthMethod *AuthMethod `protobuf:"bytes,1,opt,name=auth_method,json=authMethod,proto3" json:"auth_method,omitempty"` -} - -func (x *CreateAuthMethodResponse) Reset() { - *x = CreateAuthMethodResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateAuthMethodResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAuthMethodResponse) ProtoMessage() {} - -func (x *CreateAuthMethodResponse) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateAuthMethodResponse.ProtoReflect.Descriptor instead. -func (*CreateAuthMethodResponse) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_methods_proto_rawDescGZIP(), []int{4} -} - -func (x *CreateAuthMethodResponse) GetAuthMethod() *AuthMethod { - if x != nil { - return x.AuthMethod - } - return nil -} - -type ListAuthMethodsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ListAuthMethodsRequest) Reset() { - *x = ListAuthMethodsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAuthMethodsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAuthMethodsRequest) ProtoMessage() {} - -func (x *ListAuthMethodsRequest) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAuthMethodsRequest.ProtoReflect.Descriptor instead. -func (*ListAuthMethodsRequest) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_methods_proto_rawDescGZIP(), []int{5} -} - -type ListAuthMethodsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AuthMethods []*AuthMethod `protobuf:"bytes,1,rep,name=auth_methods,json=authMethods,proto3" json:"auth_methods,omitempty"` -} - -func (x *ListAuthMethodsResponse) Reset() { - *x = ListAuthMethodsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAuthMethodsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAuthMethodsResponse) ProtoMessage() {} - -func (x *ListAuthMethodsResponse) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAuthMethodsResponse.ProtoReflect.Descriptor instead. -func (*ListAuthMethodsResponse) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_methods_proto_rawDescGZIP(), []int{6} -} - -func (x *ListAuthMethodsResponse) GetAuthMethods() []*AuthMethod { - if x != nil { - return x.AuthMethods - } - return nil -} - -type DeleteAuthMethodRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AuthMethodId uint64 `protobuf:"varint,1,opt,name=auth_method_id,json=authMethodId,proto3" json:"auth_method_id,omitempty"` - Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` -} - -func (x *DeleteAuthMethodRequest) Reset() { - *x = DeleteAuthMethodRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteAuthMethodRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAuthMethodRequest) ProtoMessage() {} - -func (x *DeleteAuthMethodRequest) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteAuthMethodRequest.ProtoReflect.Descriptor instead. -func (*DeleteAuthMethodRequest) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_methods_proto_rawDescGZIP(), []int{7} -} - -func (x *DeleteAuthMethodRequest) GetAuthMethodId() uint64 { - if x != nil { - return x.AuthMethodId - } - return 0 -} - -func (x *DeleteAuthMethodRequest) GetForce() bool { - if x != nil { - return x.Force - } - return false -} - -type DeleteAuthMethodResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteAuthMethodResponse) Reset() { - *x = DeleteAuthMethodResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteAuthMethodResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAuthMethodResponse) ProtoMessage() {} - -func (x *DeleteAuthMethodResponse) ProtoReflect() protoreflect.Message { - mi := &file_ionscale_v1_auth_methods_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteAuthMethodResponse.ProtoReflect.Descriptor instead. -func (*DeleteAuthMethodResponse) Descriptor() ([]byte, []int) { - return file_ionscale_v1_auth_methods_proto_rawDescGZIP(), []int{8} -} - -var File_ionscale_v1_auth_methods_proto protoreflect.FileDescriptor - -var file_ionscale_v1_auth_methods_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, - 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0b, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x9e, 0x01, - 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x3c, - 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, - 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, 0x64, 0x22, 0x51, 0x0a, 0x15, - 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x6f, 0x6e, - 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x22, - 0x9b, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x54, 0x0a, - 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x61, 0x75, 0x74, - 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, - 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x22, 0x18, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x55, 0x0a, - 0x17, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0c, 0x61, 0x75, 0x74, 0x68, - 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, - 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x73, 0x22, 0x55, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, - 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x24, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6a, 0x73, 0x69, 0x65, 0x62, 0x65, 0x6e, 0x73, 0x2f, 0x69, - 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x2f, - 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x6f, 0x6e, 0x73, - 0x63, 0x61, 0x6c, 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_ionscale_v1_auth_methods_proto_rawDescOnce sync.Once - file_ionscale_v1_auth_methods_proto_rawDescData = file_ionscale_v1_auth_methods_proto_rawDesc -) - -func file_ionscale_v1_auth_methods_proto_rawDescGZIP() []byte { - file_ionscale_v1_auth_methods_proto_rawDescOnce.Do(func() { - file_ionscale_v1_auth_methods_proto_rawDescData = protoimpl.X.CompressGZIP(file_ionscale_v1_auth_methods_proto_rawDescData) - }) - return file_ionscale_v1_auth_methods_proto_rawDescData -} - -var file_ionscale_v1_auth_methods_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_ionscale_v1_auth_methods_proto_goTypes = []interface{}{ - (*AuthMethod)(nil), // 0: ionscale.v1.AuthMethod - (*GetAuthMethodRequest)(nil), // 1: ionscale.v1.GetAuthMethodRequest - (*GetAuthMethodResponse)(nil), // 2: ionscale.v1.GetAuthMethodResponse - (*CreateAuthMethodRequest)(nil), // 3: ionscale.v1.CreateAuthMethodRequest - (*CreateAuthMethodResponse)(nil), // 4: ionscale.v1.CreateAuthMethodResponse - (*ListAuthMethodsRequest)(nil), // 5: ionscale.v1.ListAuthMethodsRequest - (*ListAuthMethodsResponse)(nil), // 6: ionscale.v1.ListAuthMethodsResponse - (*DeleteAuthMethodRequest)(nil), // 7: ionscale.v1.DeleteAuthMethodRequest - (*DeleteAuthMethodResponse)(nil), // 8: ionscale.v1.DeleteAuthMethodResponse -} -var file_ionscale_v1_auth_methods_proto_depIdxs = []int32{ - 0, // 0: ionscale.v1.GetAuthMethodResponse.auth_method:type_name -> ionscale.v1.AuthMethod - 0, // 1: ionscale.v1.CreateAuthMethodResponse.auth_method:type_name -> ionscale.v1.AuthMethod - 0, // 2: ionscale.v1.ListAuthMethodsResponse.auth_methods:type_name -> ionscale.v1.AuthMethod - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_ionscale_v1_auth_methods_proto_init() } -func file_ionscale_v1_auth_methods_proto_init() { - if File_ionscale_v1_auth_methods_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_ionscale_v1_auth_methods_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthMethod); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_methods_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAuthMethodRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_methods_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAuthMethodResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_methods_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAuthMethodRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_methods_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAuthMethodResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_methods_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAuthMethodsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_methods_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAuthMethodsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_methods_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteAuthMethodRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ionscale_v1_auth_methods_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteAuthMethodResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_ionscale_v1_auth_methods_proto_rawDesc, - NumEnums: 0, - NumMessages: 9, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_ionscale_v1_auth_methods_proto_goTypes, - DependencyIndexes: file_ionscale_v1_auth_methods_proto_depIdxs, - MessageInfos: file_ionscale_v1_auth_methods_proto_msgTypes, - }.Build() - File_ionscale_v1_auth_methods_proto = out.File - file_ionscale_v1_auth_methods_proto_rawDesc = nil - file_ionscale_v1_auth_methods_proto_goTypes = nil - file_ionscale_v1_auth_methods_proto_depIdxs = nil -} diff --git a/pkg/gen/ionscale/v1/ionscale.pb.go b/pkg/gen/ionscale/v1/ionscale.pb.go index 262ed18..595ffb5 100644 --- a/pkg/gen/ionscale/v1/ionscale.pb.go +++ b/pkg/gen/ionscale/v1/ionscale.pb.go @@ -37,8 +37,6 @@ var file_ionscale_v1_ionscale_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x61, 0x69, 0x6c, 0x6e, 0x65, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1e, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x63, @@ -50,7 +48,7 @@ var file_ionscale_v1_ionscale_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x72, 0x70, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x32, 0xac, 0x14, 0x0a, 0x0f, 0x49, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x53, + 0x74, 0x6f, 0x32, 0xac, 0x11, 0x0a, 0x0f, 0x49, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, @@ -72,30 +70,6 @@ var file_ionscale_v1_ionscale_proto_rawDesc = []byte{ 0x31, 0x2e, 0x53, 0x65, 0x74, 0x44, 0x45, 0x52, 0x50, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x44, 0x45, 0x52, 0x50, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, - 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x21, 0x2e, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, - 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x69, 0x6f, 0x6e, - 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x61, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x12, 0x24, 0x2e, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x69, 0x6f, 0x6e, - 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, - 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x61, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, - 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x24, 0x2e, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, - 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, - 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, - 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x23, 0x2e, 0x69, 0x6f, 0x6e, 0x73, - 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, - 0x2e, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x41, 0x75, 0x74, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x69, 0x6c, 0x6e, 0x65, 0x74, 0x12, 0x21, 0x2e, 0x69, 0x6f, 0x6e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x69, 0x6c, @@ -225,121 +199,105 @@ var file_ionscale_v1_ionscale_proto_goTypes = []interface{}{ (*AuthenticationRequest)(nil), // 1: ionscale.v1.AuthenticationRequest (*GetDERPMapRequest)(nil), // 2: ionscale.v1.GetDERPMapRequest (*SetDERPMapRequest)(nil), // 3: ionscale.v1.SetDERPMapRequest - (*GetAuthMethodRequest)(nil), // 4: ionscale.v1.GetAuthMethodRequest - (*CreateAuthMethodRequest)(nil), // 5: ionscale.v1.CreateAuthMethodRequest - (*DeleteAuthMethodRequest)(nil), // 6: ionscale.v1.DeleteAuthMethodRequest - (*ListAuthMethodsRequest)(nil), // 7: ionscale.v1.ListAuthMethodsRequest - (*CreateTailnetRequest)(nil), // 8: ionscale.v1.CreateTailnetRequest - (*GetTailnetRequest)(nil), // 9: ionscale.v1.GetTailnetRequest - (*ListTailnetRequest)(nil), // 10: ionscale.v1.ListTailnetRequest - (*DeleteTailnetRequest)(nil), // 11: ionscale.v1.DeleteTailnetRequest - (*GetDNSConfigRequest)(nil), // 12: ionscale.v1.GetDNSConfigRequest - (*SetDNSConfigRequest)(nil), // 13: ionscale.v1.SetDNSConfigRequest - (*GetIAMPolicyRequest)(nil), // 14: ionscale.v1.GetIAMPolicyRequest - (*SetIAMPolicyRequest)(nil), // 15: ionscale.v1.SetIAMPolicyRequest - (*GetACLPolicyRequest)(nil), // 16: ionscale.v1.GetACLPolicyRequest - (*SetACLPolicyRequest)(nil), // 17: ionscale.v1.SetACLPolicyRequest - (*GetAuthKeyRequest)(nil), // 18: ionscale.v1.GetAuthKeyRequest - (*CreateAuthKeyRequest)(nil), // 19: ionscale.v1.CreateAuthKeyRequest - (*DeleteAuthKeyRequest)(nil), // 20: ionscale.v1.DeleteAuthKeyRequest - (*ListAuthKeysRequest)(nil), // 21: ionscale.v1.ListAuthKeysRequest - (*ListUsersRequest)(nil), // 22: ionscale.v1.ListUsersRequest - (*ListMachinesRequest)(nil), // 23: ionscale.v1.ListMachinesRequest - (*ExpireMachineRequest)(nil), // 24: ionscale.v1.ExpireMachineRequest - (*DeleteMachineRequest)(nil), // 25: ionscale.v1.DeleteMachineRequest - (*SetMachineKeyExpiryRequest)(nil), // 26: ionscale.v1.SetMachineKeyExpiryRequest - (*GetMachineRoutesRequest)(nil), // 27: ionscale.v1.GetMachineRoutesRequest - (*SetMachineRoutesRequest)(nil), // 28: ionscale.v1.SetMachineRoutesRequest - (*GetVersionResponse)(nil), // 29: ionscale.v1.GetVersionResponse - (*AuthenticationResponse)(nil), // 30: ionscale.v1.AuthenticationResponse - (*GetDERPMapResponse)(nil), // 31: ionscale.v1.GetDERPMapResponse - (*SetDERPMapResponse)(nil), // 32: ionscale.v1.SetDERPMapResponse - (*GetAuthMethodResponse)(nil), // 33: ionscale.v1.GetAuthMethodResponse - (*CreateAuthMethodResponse)(nil), // 34: ionscale.v1.CreateAuthMethodResponse - (*DeleteAuthMethodResponse)(nil), // 35: ionscale.v1.DeleteAuthMethodResponse - (*ListAuthMethodsResponse)(nil), // 36: ionscale.v1.ListAuthMethodsResponse - (*CreateTailnetResponse)(nil), // 37: ionscale.v1.CreateTailnetResponse - (*GetTailnetResponse)(nil), // 38: ionscale.v1.GetTailnetResponse - (*ListTailnetResponse)(nil), // 39: ionscale.v1.ListTailnetResponse - (*DeleteTailnetResponse)(nil), // 40: ionscale.v1.DeleteTailnetResponse - (*GetDNSConfigResponse)(nil), // 41: ionscale.v1.GetDNSConfigResponse - (*SetDNSConfigResponse)(nil), // 42: ionscale.v1.SetDNSConfigResponse - (*GetIAMPolicyResponse)(nil), // 43: ionscale.v1.GetIAMPolicyResponse - (*SetIAMPolicyResponse)(nil), // 44: ionscale.v1.SetIAMPolicyResponse - (*GetACLPolicyResponse)(nil), // 45: ionscale.v1.GetACLPolicyResponse - (*SetACLPolicyResponse)(nil), // 46: ionscale.v1.SetACLPolicyResponse - (*GetAuthKeyResponse)(nil), // 47: ionscale.v1.GetAuthKeyResponse - (*CreateAuthKeyResponse)(nil), // 48: ionscale.v1.CreateAuthKeyResponse - (*DeleteAuthKeyResponse)(nil), // 49: ionscale.v1.DeleteAuthKeyResponse - (*ListAuthKeysResponse)(nil), // 50: ionscale.v1.ListAuthKeysResponse - (*ListUsersResponse)(nil), // 51: ionscale.v1.ListUsersResponse - (*ListMachinesResponse)(nil), // 52: ionscale.v1.ListMachinesResponse - (*ExpireMachineResponse)(nil), // 53: ionscale.v1.ExpireMachineResponse - (*DeleteMachineResponse)(nil), // 54: ionscale.v1.DeleteMachineResponse - (*SetMachineKeyExpiryResponse)(nil), // 55: ionscale.v1.SetMachineKeyExpiryResponse - (*GetMachineRoutesResponse)(nil), // 56: ionscale.v1.GetMachineRoutesResponse + (*CreateTailnetRequest)(nil), // 4: ionscale.v1.CreateTailnetRequest + (*GetTailnetRequest)(nil), // 5: ionscale.v1.GetTailnetRequest + (*ListTailnetRequest)(nil), // 6: ionscale.v1.ListTailnetRequest + (*DeleteTailnetRequest)(nil), // 7: ionscale.v1.DeleteTailnetRequest + (*GetDNSConfigRequest)(nil), // 8: ionscale.v1.GetDNSConfigRequest + (*SetDNSConfigRequest)(nil), // 9: ionscale.v1.SetDNSConfigRequest + (*GetIAMPolicyRequest)(nil), // 10: ionscale.v1.GetIAMPolicyRequest + (*SetIAMPolicyRequest)(nil), // 11: ionscale.v1.SetIAMPolicyRequest + (*GetACLPolicyRequest)(nil), // 12: ionscale.v1.GetACLPolicyRequest + (*SetACLPolicyRequest)(nil), // 13: ionscale.v1.SetACLPolicyRequest + (*GetAuthKeyRequest)(nil), // 14: ionscale.v1.GetAuthKeyRequest + (*CreateAuthKeyRequest)(nil), // 15: ionscale.v1.CreateAuthKeyRequest + (*DeleteAuthKeyRequest)(nil), // 16: ionscale.v1.DeleteAuthKeyRequest + (*ListAuthKeysRequest)(nil), // 17: ionscale.v1.ListAuthKeysRequest + (*ListUsersRequest)(nil), // 18: ionscale.v1.ListUsersRequest + (*ListMachinesRequest)(nil), // 19: ionscale.v1.ListMachinesRequest + (*ExpireMachineRequest)(nil), // 20: ionscale.v1.ExpireMachineRequest + (*DeleteMachineRequest)(nil), // 21: ionscale.v1.DeleteMachineRequest + (*SetMachineKeyExpiryRequest)(nil), // 22: ionscale.v1.SetMachineKeyExpiryRequest + (*GetMachineRoutesRequest)(nil), // 23: ionscale.v1.GetMachineRoutesRequest + (*SetMachineRoutesRequest)(nil), // 24: ionscale.v1.SetMachineRoutesRequest + (*GetVersionResponse)(nil), // 25: ionscale.v1.GetVersionResponse + (*AuthenticationResponse)(nil), // 26: ionscale.v1.AuthenticationResponse + (*GetDERPMapResponse)(nil), // 27: ionscale.v1.GetDERPMapResponse + (*SetDERPMapResponse)(nil), // 28: ionscale.v1.SetDERPMapResponse + (*CreateTailnetResponse)(nil), // 29: ionscale.v1.CreateTailnetResponse + (*GetTailnetResponse)(nil), // 30: ionscale.v1.GetTailnetResponse + (*ListTailnetResponse)(nil), // 31: ionscale.v1.ListTailnetResponse + (*DeleteTailnetResponse)(nil), // 32: ionscale.v1.DeleteTailnetResponse + (*GetDNSConfigResponse)(nil), // 33: ionscale.v1.GetDNSConfigResponse + (*SetDNSConfigResponse)(nil), // 34: ionscale.v1.SetDNSConfigResponse + (*GetIAMPolicyResponse)(nil), // 35: ionscale.v1.GetIAMPolicyResponse + (*SetIAMPolicyResponse)(nil), // 36: ionscale.v1.SetIAMPolicyResponse + (*GetACLPolicyResponse)(nil), // 37: ionscale.v1.GetACLPolicyResponse + (*SetACLPolicyResponse)(nil), // 38: ionscale.v1.SetACLPolicyResponse + (*GetAuthKeyResponse)(nil), // 39: ionscale.v1.GetAuthKeyResponse + (*CreateAuthKeyResponse)(nil), // 40: ionscale.v1.CreateAuthKeyResponse + (*DeleteAuthKeyResponse)(nil), // 41: ionscale.v1.DeleteAuthKeyResponse + (*ListAuthKeysResponse)(nil), // 42: ionscale.v1.ListAuthKeysResponse + (*ListUsersResponse)(nil), // 43: ionscale.v1.ListUsersResponse + (*ListMachinesResponse)(nil), // 44: ionscale.v1.ListMachinesResponse + (*ExpireMachineResponse)(nil), // 45: ionscale.v1.ExpireMachineResponse + (*DeleteMachineResponse)(nil), // 46: ionscale.v1.DeleteMachineResponse + (*SetMachineKeyExpiryResponse)(nil), // 47: ionscale.v1.SetMachineKeyExpiryResponse + (*GetMachineRoutesResponse)(nil), // 48: ionscale.v1.GetMachineRoutesResponse } var file_ionscale_v1_ionscale_proto_depIdxs = []int32{ 0, // 0: ionscale.v1.IonscaleService.GetVersion:input_type -> ionscale.v1.GetVersionRequest 1, // 1: ionscale.v1.IonscaleService.Authenticate:input_type -> ionscale.v1.AuthenticationRequest 2, // 2: ionscale.v1.IonscaleService.GetDERPMap:input_type -> ionscale.v1.GetDERPMapRequest 3, // 3: ionscale.v1.IonscaleService.SetDERPMap:input_type -> ionscale.v1.SetDERPMapRequest - 4, // 4: ionscale.v1.IonscaleService.GetAuthMethod:input_type -> ionscale.v1.GetAuthMethodRequest - 5, // 5: ionscale.v1.IonscaleService.CreateAuthMethod:input_type -> ionscale.v1.CreateAuthMethodRequest - 6, // 6: ionscale.v1.IonscaleService.DeleteAuthMethod:input_type -> ionscale.v1.DeleteAuthMethodRequest - 7, // 7: ionscale.v1.IonscaleService.ListAuthMethods:input_type -> ionscale.v1.ListAuthMethodsRequest - 8, // 8: ionscale.v1.IonscaleService.CreateTailnet:input_type -> ionscale.v1.CreateTailnetRequest - 9, // 9: ionscale.v1.IonscaleService.GetTailnet:input_type -> ionscale.v1.GetTailnetRequest - 10, // 10: ionscale.v1.IonscaleService.ListTailnets:input_type -> ionscale.v1.ListTailnetRequest - 11, // 11: ionscale.v1.IonscaleService.DeleteTailnet:input_type -> ionscale.v1.DeleteTailnetRequest - 12, // 12: ionscale.v1.IonscaleService.GetDNSConfig:input_type -> ionscale.v1.GetDNSConfigRequest - 13, // 13: ionscale.v1.IonscaleService.SetDNSConfig:input_type -> ionscale.v1.SetDNSConfigRequest - 14, // 14: ionscale.v1.IonscaleService.GetIAMPolicy:input_type -> ionscale.v1.GetIAMPolicyRequest - 15, // 15: ionscale.v1.IonscaleService.SetIAMPolicy:input_type -> ionscale.v1.SetIAMPolicyRequest - 16, // 16: ionscale.v1.IonscaleService.GetACLPolicy:input_type -> ionscale.v1.GetACLPolicyRequest - 17, // 17: ionscale.v1.IonscaleService.SetACLPolicy:input_type -> ionscale.v1.SetACLPolicyRequest - 18, // 18: ionscale.v1.IonscaleService.GetAuthKey:input_type -> ionscale.v1.GetAuthKeyRequest - 19, // 19: ionscale.v1.IonscaleService.CreateAuthKey:input_type -> ionscale.v1.CreateAuthKeyRequest - 20, // 20: ionscale.v1.IonscaleService.DeleteAuthKey:input_type -> ionscale.v1.DeleteAuthKeyRequest - 21, // 21: ionscale.v1.IonscaleService.ListAuthKeys:input_type -> ionscale.v1.ListAuthKeysRequest - 22, // 22: ionscale.v1.IonscaleService.ListUsers:input_type -> ionscale.v1.ListUsersRequest - 23, // 23: ionscale.v1.IonscaleService.ListMachines:input_type -> ionscale.v1.ListMachinesRequest - 24, // 24: ionscale.v1.IonscaleService.ExpireMachine:input_type -> ionscale.v1.ExpireMachineRequest - 25, // 25: ionscale.v1.IonscaleService.DeleteMachine:input_type -> ionscale.v1.DeleteMachineRequest - 26, // 26: ionscale.v1.IonscaleService.SetMachineKeyExpiry:input_type -> ionscale.v1.SetMachineKeyExpiryRequest - 27, // 27: ionscale.v1.IonscaleService.GetMachineRoutes:input_type -> ionscale.v1.GetMachineRoutesRequest - 28, // 28: ionscale.v1.IonscaleService.SetMachineRoutes:input_type -> ionscale.v1.SetMachineRoutesRequest - 29, // 29: ionscale.v1.IonscaleService.GetVersion:output_type -> ionscale.v1.GetVersionResponse - 30, // 30: ionscale.v1.IonscaleService.Authenticate:output_type -> ionscale.v1.AuthenticationResponse - 31, // 31: ionscale.v1.IonscaleService.GetDERPMap:output_type -> ionscale.v1.GetDERPMapResponse - 32, // 32: ionscale.v1.IonscaleService.SetDERPMap:output_type -> ionscale.v1.SetDERPMapResponse - 33, // 33: ionscale.v1.IonscaleService.GetAuthMethod:output_type -> ionscale.v1.GetAuthMethodResponse - 34, // 34: ionscale.v1.IonscaleService.CreateAuthMethod:output_type -> ionscale.v1.CreateAuthMethodResponse - 35, // 35: ionscale.v1.IonscaleService.DeleteAuthMethod:output_type -> ionscale.v1.DeleteAuthMethodResponse - 36, // 36: ionscale.v1.IonscaleService.ListAuthMethods:output_type -> ionscale.v1.ListAuthMethodsResponse - 37, // 37: ionscale.v1.IonscaleService.CreateTailnet:output_type -> ionscale.v1.CreateTailnetResponse - 38, // 38: ionscale.v1.IonscaleService.GetTailnet:output_type -> ionscale.v1.GetTailnetResponse - 39, // 39: ionscale.v1.IonscaleService.ListTailnets:output_type -> ionscale.v1.ListTailnetResponse - 40, // 40: ionscale.v1.IonscaleService.DeleteTailnet:output_type -> ionscale.v1.DeleteTailnetResponse - 41, // 41: ionscale.v1.IonscaleService.GetDNSConfig:output_type -> ionscale.v1.GetDNSConfigResponse - 42, // 42: ionscale.v1.IonscaleService.SetDNSConfig:output_type -> ionscale.v1.SetDNSConfigResponse - 43, // 43: ionscale.v1.IonscaleService.GetIAMPolicy:output_type -> ionscale.v1.GetIAMPolicyResponse - 44, // 44: ionscale.v1.IonscaleService.SetIAMPolicy:output_type -> ionscale.v1.SetIAMPolicyResponse - 45, // 45: ionscale.v1.IonscaleService.GetACLPolicy:output_type -> ionscale.v1.GetACLPolicyResponse - 46, // 46: ionscale.v1.IonscaleService.SetACLPolicy:output_type -> ionscale.v1.SetACLPolicyResponse - 47, // 47: ionscale.v1.IonscaleService.GetAuthKey:output_type -> ionscale.v1.GetAuthKeyResponse - 48, // 48: ionscale.v1.IonscaleService.CreateAuthKey:output_type -> ionscale.v1.CreateAuthKeyResponse - 49, // 49: ionscale.v1.IonscaleService.DeleteAuthKey:output_type -> ionscale.v1.DeleteAuthKeyResponse - 50, // 50: ionscale.v1.IonscaleService.ListAuthKeys:output_type -> ionscale.v1.ListAuthKeysResponse - 51, // 51: ionscale.v1.IonscaleService.ListUsers:output_type -> ionscale.v1.ListUsersResponse - 52, // 52: ionscale.v1.IonscaleService.ListMachines:output_type -> ionscale.v1.ListMachinesResponse - 53, // 53: ionscale.v1.IonscaleService.ExpireMachine:output_type -> ionscale.v1.ExpireMachineResponse - 54, // 54: ionscale.v1.IonscaleService.DeleteMachine:output_type -> ionscale.v1.DeleteMachineResponse - 55, // 55: ionscale.v1.IonscaleService.SetMachineKeyExpiry:output_type -> ionscale.v1.SetMachineKeyExpiryResponse - 56, // 56: ionscale.v1.IonscaleService.GetMachineRoutes:output_type -> ionscale.v1.GetMachineRoutesResponse - 56, // 57: ionscale.v1.IonscaleService.SetMachineRoutes:output_type -> ionscale.v1.GetMachineRoutesResponse - 29, // [29:58] is the sub-list for method output_type - 0, // [0:29] is the sub-list for method input_type + 4, // 4: ionscale.v1.IonscaleService.CreateTailnet:input_type -> ionscale.v1.CreateTailnetRequest + 5, // 5: ionscale.v1.IonscaleService.GetTailnet:input_type -> ionscale.v1.GetTailnetRequest + 6, // 6: ionscale.v1.IonscaleService.ListTailnets:input_type -> ionscale.v1.ListTailnetRequest + 7, // 7: ionscale.v1.IonscaleService.DeleteTailnet:input_type -> ionscale.v1.DeleteTailnetRequest + 8, // 8: ionscale.v1.IonscaleService.GetDNSConfig:input_type -> ionscale.v1.GetDNSConfigRequest + 9, // 9: ionscale.v1.IonscaleService.SetDNSConfig:input_type -> ionscale.v1.SetDNSConfigRequest + 10, // 10: ionscale.v1.IonscaleService.GetIAMPolicy:input_type -> ionscale.v1.GetIAMPolicyRequest + 11, // 11: ionscale.v1.IonscaleService.SetIAMPolicy:input_type -> ionscale.v1.SetIAMPolicyRequest + 12, // 12: ionscale.v1.IonscaleService.GetACLPolicy:input_type -> ionscale.v1.GetACLPolicyRequest + 13, // 13: ionscale.v1.IonscaleService.SetACLPolicy:input_type -> ionscale.v1.SetACLPolicyRequest + 14, // 14: ionscale.v1.IonscaleService.GetAuthKey:input_type -> ionscale.v1.GetAuthKeyRequest + 15, // 15: ionscale.v1.IonscaleService.CreateAuthKey:input_type -> ionscale.v1.CreateAuthKeyRequest + 16, // 16: ionscale.v1.IonscaleService.DeleteAuthKey:input_type -> ionscale.v1.DeleteAuthKeyRequest + 17, // 17: ionscale.v1.IonscaleService.ListAuthKeys:input_type -> ionscale.v1.ListAuthKeysRequest + 18, // 18: ionscale.v1.IonscaleService.ListUsers:input_type -> ionscale.v1.ListUsersRequest + 19, // 19: ionscale.v1.IonscaleService.ListMachines:input_type -> ionscale.v1.ListMachinesRequest + 20, // 20: ionscale.v1.IonscaleService.ExpireMachine:input_type -> ionscale.v1.ExpireMachineRequest + 21, // 21: ionscale.v1.IonscaleService.DeleteMachine:input_type -> ionscale.v1.DeleteMachineRequest + 22, // 22: ionscale.v1.IonscaleService.SetMachineKeyExpiry:input_type -> ionscale.v1.SetMachineKeyExpiryRequest + 23, // 23: ionscale.v1.IonscaleService.GetMachineRoutes:input_type -> ionscale.v1.GetMachineRoutesRequest + 24, // 24: ionscale.v1.IonscaleService.SetMachineRoutes:input_type -> ionscale.v1.SetMachineRoutesRequest + 25, // 25: ionscale.v1.IonscaleService.GetVersion:output_type -> ionscale.v1.GetVersionResponse + 26, // 26: ionscale.v1.IonscaleService.Authenticate:output_type -> ionscale.v1.AuthenticationResponse + 27, // 27: ionscale.v1.IonscaleService.GetDERPMap:output_type -> ionscale.v1.GetDERPMapResponse + 28, // 28: ionscale.v1.IonscaleService.SetDERPMap:output_type -> ionscale.v1.SetDERPMapResponse + 29, // 29: ionscale.v1.IonscaleService.CreateTailnet:output_type -> ionscale.v1.CreateTailnetResponse + 30, // 30: ionscale.v1.IonscaleService.GetTailnet:output_type -> ionscale.v1.GetTailnetResponse + 31, // 31: ionscale.v1.IonscaleService.ListTailnets:output_type -> ionscale.v1.ListTailnetResponse + 32, // 32: ionscale.v1.IonscaleService.DeleteTailnet:output_type -> ionscale.v1.DeleteTailnetResponse + 33, // 33: ionscale.v1.IonscaleService.GetDNSConfig:output_type -> ionscale.v1.GetDNSConfigResponse + 34, // 34: ionscale.v1.IonscaleService.SetDNSConfig:output_type -> ionscale.v1.SetDNSConfigResponse + 35, // 35: ionscale.v1.IonscaleService.GetIAMPolicy:output_type -> ionscale.v1.GetIAMPolicyResponse + 36, // 36: ionscale.v1.IonscaleService.SetIAMPolicy:output_type -> ionscale.v1.SetIAMPolicyResponse + 37, // 37: ionscale.v1.IonscaleService.GetACLPolicy:output_type -> ionscale.v1.GetACLPolicyResponse + 38, // 38: ionscale.v1.IonscaleService.SetACLPolicy:output_type -> ionscale.v1.SetACLPolicyResponse + 39, // 39: ionscale.v1.IonscaleService.GetAuthKey:output_type -> ionscale.v1.GetAuthKeyResponse + 40, // 40: ionscale.v1.IonscaleService.CreateAuthKey:output_type -> ionscale.v1.CreateAuthKeyResponse + 41, // 41: ionscale.v1.IonscaleService.DeleteAuthKey:output_type -> ionscale.v1.DeleteAuthKeyResponse + 42, // 42: ionscale.v1.IonscaleService.ListAuthKeys:output_type -> ionscale.v1.ListAuthKeysResponse + 43, // 43: ionscale.v1.IonscaleService.ListUsers:output_type -> ionscale.v1.ListUsersResponse + 44, // 44: ionscale.v1.IonscaleService.ListMachines:output_type -> ionscale.v1.ListMachinesResponse + 45, // 45: ionscale.v1.IonscaleService.ExpireMachine:output_type -> ionscale.v1.ExpireMachineResponse + 46, // 46: ionscale.v1.IonscaleService.DeleteMachine:output_type -> ionscale.v1.DeleteMachineResponse + 47, // 47: ionscale.v1.IonscaleService.SetMachineKeyExpiry:output_type -> ionscale.v1.SetMachineKeyExpiryResponse + 48, // 48: ionscale.v1.IonscaleService.GetMachineRoutes:output_type -> ionscale.v1.GetMachineRoutesResponse + 48, // 49: ionscale.v1.IonscaleService.SetMachineRoutes:output_type -> ionscale.v1.GetMachineRoutesResponse + 25, // [25:50] is the sub-list for method output_type + 0, // [0:25] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -354,7 +312,6 @@ func file_ionscale_v1_ionscale_proto_init() { file_ionscale_v1_auth_proto_init() file_ionscale_v1_tailnets_proto_init() file_ionscale_v1_users_proto_init() - file_ionscale_v1_auth_methods_proto_init() file_ionscale_v1_auth_keys_proto_init() file_ionscale_v1_machines_proto_init() file_ionscale_v1_routes_proto_init() diff --git a/pkg/gen/ionscale/v1/ionscalev1connect/ionscale.connect.go b/pkg/gen/ionscale/v1/ionscalev1connect/ionscale.connect.go index d32c2ea..1762c51 100644 --- a/pkg/gen/ionscale/v1/ionscalev1connect/ionscale.connect.go +++ b/pkg/gen/ionscale/v1/ionscalev1connect/ionscale.connect.go @@ -31,10 +31,6 @@ type IonscaleServiceClient interface { Authenticate(context.Context, *connect_go.Request[v1.AuthenticationRequest]) (*connect_go.ServerStreamForClient[v1.AuthenticationResponse], error) GetDERPMap(context.Context, *connect_go.Request[v1.GetDERPMapRequest]) (*connect_go.Response[v1.GetDERPMapResponse], error) SetDERPMap(context.Context, *connect_go.Request[v1.SetDERPMapRequest]) (*connect_go.Response[v1.SetDERPMapResponse], error) - GetAuthMethod(context.Context, *connect_go.Request[v1.GetAuthMethodRequest]) (*connect_go.Response[v1.GetAuthMethodResponse], error) - CreateAuthMethod(context.Context, *connect_go.Request[v1.CreateAuthMethodRequest]) (*connect_go.Response[v1.CreateAuthMethodResponse], error) - DeleteAuthMethod(context.Context, *connect_go.Request[v1.DeleteAuthMethodRequest]) (*connect_go.Response[v1.DeleteAuthMethodResponse], error) - ListAuthMethods(context.Context, *connect_go.Request[v1.ListAuthMethodsRequest]) (*connect_go.Response[v1.ListAuthMethodsResponse], error) CreateTailnet(context.Context, *connect_go.Request[v1.CreateTailnetRequest]) (*connect_go.Response[v1.CreateTailnetResponse], error) GetTailnet(context.Context, *connect_go.Request[v1.GetTailnetRequest]) (*connect_go.Response[v1.GetTailnetResponse], error) ListTailnets(context.Context, *connect_go.Request[v1.ListTailnetRequest]) (*connect_go.Response[v1.ListTailnetResponse], error) @@ -88,26 +84,6 @@ func NewIonscaleServiceClient(httpClient connect_go.HTTPClient, baseURL string, baseURL+"/ionscale.v1.IonscaleService/SetDERPMap", opts..., ), - getAuthMethod: connect_go.NewClient[v1.GetAuthMethodRequest, v1.GetAuthMethodResponse]( - httpClient, - baseURL+"/ionscale.v1.IonscaleService/GetAuthMethod", - opts..., - ), - createAuthMethod: connect_go.NewClient[v1.CreateAuthMethodRequest, v1.CreateAuthMethodResponse]( - httpClient, - baseURL+"/ionscale.v1.IonscaleService/CreateAuthMethod", - opts..., - ), - deleteAuthMethod: connect_go.NewClient[v1.DeleteAuthMethodRequest, v1.DeleteAuthMethodResponse]( - httpClient, - baseURL+"/ionscale.v1.IonscaleService/DeleteAuthMethod", - opts..., - ), - listAuthMethods: connect_go.NewClient[v1.ListAuthMethodsRequest, v1.ListAuthMethodsResponse]( - httpClient, - baseURL+"/ionscale.v1.IonscaleService/ListAuthMethods", - opts..., - ), createTailnet: connect_go.NewClient[v1.CreateTailnetRequest, v1.CreateTailnetResponse]( httpClient, baseURL+"/ionscale.v1.IonscaleService/CreateTailnet", @@ -222,10 +198,6 @@ type ionscaleServiceClient struct { authenticate *connect_go.Client[v1.AuthenticationRequest, v1.AuthenticationResponse] getDERPMap *connect_go.Client[v1.GetDERPMapRequest, v1.GetDERPMapResponse] setDERPMap *connect_go.Client[v1.SetDERPMapRequest, v1.SetDERPMapResponse] - getAuthMethod *connect_go.Client[v1.GetAuthMethodRequest, v1.GetAuthMethodResponse] - createAuthMethod *connect_go.Client[v1.CreateAuthMethodRequest, v1.CreateAuthMethodResponse] - deleteAuthMethod *connect_go.Client[v1.DeleteAuthMethodRequest, v1.DeleteAuthMethodResponse] - listAuthMethods *connect_go.Client[v1.ListAuthMethodsRequest, v1.ListAuthMethodsResponse] createTailnet *connect_go.Client[v1.CreateTailnetRequest, v1.CreateTailnetResponse] getTailnet *connect_go.Client[v1.GetTailnetRequest, v1.GetTailnetResponse] listTailnets *connect_go.Client[v1.ListTailnetRequest, v1.ListTailnetResponse] @@ -269,26 +241,6 @@ func (c *ionscaleServiceClient) SetDERPMap(ctx context.Context, req *connect_go. return c.setDERPMap.CallUnary(ctx, req) } -// GetAuthMethod calls ionscale.v1.IonscaleService.GetAuthMethod. -func (c *ionscaleServiceClient) GetAuthMethod(ctx context.Context, req *connect_go.Request[v1.GetAuthMethodRequest]) (*connect_go.Response[v1.GetAuthMethodResponse], error) { - return c.getAuthMethod.CallUnary(ctx, req) -} - -// CreateAuthMethod calls ionscale.v1.IonscaleService.CreateAuthMethod. -func (c *ionscaleServiceClient) CreateAuthMethod(ctx context.Context, req *connect_go.Request[v1.CreateAuthMethodRequest]) (*connect_go.Response[v1.CreateAuthMethodResponse], error) { - return c.createAuthMethod.CallUnary(ctx, req) -} - -// DeleteAuthMethod calls ionscale.v1.IonscaleService.DeleteAuthMethod. -func (c *ionscaleServiceClient) DeleteAuthMethod(ctx context.Context, req *connect_go.Request[v1.DeleteAuthMethodRequest]) (*connect_go.Response[v1.DeleteAuthMethodResponse], error) { - return c.deleteAuthMethod.CallUnary(ctx, req) -} - -// ListAuthMethods calls ionscale.v1.IonscaleService.ListAuthMethods. -func (c *ionscaleServiceClient) ListAuthMethods(ctx context.Context, req *connect_go.Request[v1.ListAuthMethodsRequest]) (*connect_go.Response[v1.ListAuthMethodsResponse], error) { - return c.listAuthMethods.CallUnary(ctx, req) -} - // CreateTailnet calls ionscale.v1.IonscaleService.CreateTailnet. func (c *ionscaleServiceClient) CreateTailnet(ctx context.Context, req *connect_go.Request[v1.CreateTailnetRequest]) (*connect_go.Response[v1.CreateTailnetResponse], error) { return c.createTailnet.CallUnary(ctx, req) @@ -400,10 +352,6 @@ type IonscaleServiceHandler interface { Authenticate(context.Context, *connect_go.Request[v1.AuthenticationRequest], *connect_go.ServerStream[v1.AuthenticationResponse]) error GetDERPMap(context.Context, *connect_go.Request[v1.GetDERPMapRequest]) (*connect_go.Response[v1.GetDERPMapResponse], error) SetDERPMap(context.Context, *connect_go.Request[v1.SetDERPMapRequest]) (*connect_go.Response[v1.SetDERPMapResponse], error) - GetAuthMethod(context.Context, *connect_go.Request[v1.GetAuthMethodRequest]) (*connect_go.Response[v1.GetAuthMethodResponse], error) - CreateAuthMethod(context.Context, *connect_go.Request[v1.CreateAuthMethodRequest]) (*connect_go.Response[v1.CreateAuthMethodResponse], error) - DeleteAuthMethod(context.Context, *connect_go.Request[v1.DeleteAuthMethodRequest]) (*connect_go.Response[v1.DeleteAuthMethodResponse], error) - ListAuthMethods(context.Context, *connect_go.Request[v1.ListAuthMethodsRequest]) (*connect_go.Response[v1.ListAuthMethodsResponse], error) CreateTailnet(context.Context, *connect_go.Request[v1.CreateTailnetRequest]) (*connect_go.Response[v1.CreateTailnetResponse], error) GetTailnet(context.Context, *connect_go.Request[v1.GetTailnetRequest]) (*connect_go.Response[v1.GetTailnetResponse], error) ListTailnets(context.Context, *connect_go.Request[v1.ListTailnetRequest]) (*connect_go.Response[v1.ListTailnetResponse], error) @@ -454,26 +402,6 @@ func NewIonscaleServiceHandler(svc IonscaleServiceHandler, opts ...connect_go.Ha svc.SetDERPMap, opts..., )) - mux.Handle("/ionscale.v1.IonscaleService/GetAuthMethod", connect_go.NewUnaryHandler( - "/ionscale.v1.IonscaleService/GetAuthMethod", - svc.GetAuthMethod, - opts..., - )) - mux.Handle("/ionscale.v1.IonscaleService/CreateAuthMethod", connect_go.NewUnaryHandler( - "/ionscale.v1.IonscaleService/CreateAuthMethod", - svc.CreateAuthMethod, - opts..., - )) - mux.Handle("/ionscale.v1.IonscaleService/DeleteAuthMethod", connect_go.NewUnaryHandler( - "/ionscale.v1.IonscaleService/DeleteAuthMethod", - svc.DeleteAuthMethod, - opts..., - )) - mux.Handle("/ionscale.v1.IonscaleService/ListAuthMethods", connect_go.NewUnaryHandler( - "/ionscale.v1.IonscaleService/ListAuthMethods", - svc.ListAuthMethods, - opts..., - )) mux.Handle("/ionscale.v1.IonscaleService/CreateTailnet", connect_go.NewUnaryHandler( "/ionscale.v1.IonscaleService/CreateTailnet", svc.CreateTailnet, @@ -601,22 +529,6 @@ func (UnimplementedIonscaleServiceHandler) SetDERPMap(context.Context, *connect_ return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("ionscale.v1.IonscaleService.SetDERPMap is not implemented")) } -func (UnimplementedIonscaleServiceHandler) GetAuthMethod(context.Context, *connect_go.Request[v1.GetAuthMethodRequest]) (*connect_go.Response[v1.GetAuthMethodResponse], error) { - return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("ionscale.v1.IonscaleService.GetAuthMethod is not implemented")) -} - -func (UnimplementedIonscaleServiceHandler) CreateAuthMethod(context.Context, *connect_go.Request[v1.CreateAuthMethodRequest]) (*connect_go.Response[v1.CreateAuthMethodResponse], error) { - return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("ionscale.v1.IonscaleService.CreateAuthMethod is not implemented")) -} - -func (UnimplementedIonscaleServiceHandler) DeleteAuthMethod(context.Context, *connect_go.Request[v1.DeleteAuthMethodRequest]) (*connect_go.Response[v1.DeleteAuthMethodResponse], error) { - return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("ionscale.v1.IonscaleService.DeleteAuthMethod is not implemented")) -} - -func (UnimplementedIonscaleServiceHandler) ListAuthMethods(context.Context, *connect_go.Request[v1.ListAuthMethodsRequest]) (*connect_go.Response[v1.ListAuthMethodsResponse], error) { - return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("ionscale.v1.IonscaleService.ListAuthMethods is not implemented")) -} - func (UnimplementedIonscaleServiceHandler) CreateTailnet(context.Context, *connect_go.Request[v1.CreateTailnetRequest]) (*connect_go.Response[v1.CreateTailnetResponse], error) { return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("ionscale.v1.IonscaleService.CreateTailnet is not implemented")) } diff --git a/proto/ionscale/v1/auth_methods.proto b/proto/ionscale/v1/auth_methods.proto deleted file mode 100644 index 2e6b925..0000000 --- a/proto/ionscale/v1/auth_methods.proto +++ /dev/null @@ -1,46 +0,0 @@ -syntax = "proto3"; - -package ionscale.v1; -option go_package = "github.com/jsiebens/ionscale/pkg/gen/ionscale/v1;ionscalev1"; - -message AuthMethod { - uint64 id = 1; - string type = 2; - string name = 3; - string issuer = 4; - string client_id = 5; - string client_secret = 6; -} - -message GetAuthMethodRequest { - uint64 auth_method_id = 1; -} - -message GetAuthMethodResponse { - AuthMethod auth_method = 1; -} - -message CreateAuthMethodRequest { - string type = 1; - string name = 2; - string issuer = 3; - string client_id = 4; - string client_secret = 5; -} - -message CreateAuthMethodResponse { - AuthMethod auth_method = 1; -} - -message ListAuthMethodsRequest {} - -message ListAuthMethodsResponse { - repeated AuthMethod auth_methods = 1; -} - -message DeleteAuthMethodRequest { - uint64 auth_method_id = 1; - bool force = 2; -} - -message DeleteAuthMethodResponse {} \ No newline at end of file diff --git a/proto/ionscale/v1/ionscale.proto b/proto/ionscale/v1/ionscale.proto index 9da7a48..2430164 100644 --- a/proto/ionscale/v1/ionscale.proto +++ b/proto/ionscale/v1/ionscale.proto @@ -10,7 +10,6 @@ import "ionscale/v1/version.proto"; import "ionscale/v1/auth.proto"; import "ionscale/v1/tailnets.proto"; import "ionscale/v1/users.proto"; -import "ionscale/v1/auth_methods.proto"; import "ionscale/v1/auth_keys.proto"; import "ionscale/v1/machines.proto"; import "ionscale/v1/routes.proto"; @@ -27,11 +26,6 @@ service IonscaleService { rpc GetDERPMap (GetDERPMapRequest) returns (GetDERPMapResponse) {} rpc SetDERPMap (SetDERPMapRequest) returns (SetDERPMapResponse) {} - rpc GetAuthMethod (GetAuthMethodRequest) returns (GetAuthMethodResponse) {} - rpc CreateAuthMethod (CreateAuthMethodRequest) returns (CreateAuthMethodResponse) {} - rpc DeleteAuthMethod (DeleteAuthMethodRequest) returns (DeleteAuthMethodResponse) {} - rpc ListAuthMethods (ListAuthMethodsRequest) returns (ListAuthMethodsResponse) {} - rpc CreateTailnet (CreateTailnetRequest) returns (CreateTailnetResponse) {} rpc GetTailnet (GetTailnetRequest) returns (GetTailnetResponse) {} rpc ListTailnets (ListTailnetRequest) returns (ListTailnetResponse) {}