storj.io/minio@v0.0.0-20230509071714-0cbc90f649b1/cmd/config-versions.go (about)

     1  /*
     2   * MinIO Cloud Storage, (C) 2016, 2017, 2018 MinIO, Inc.
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *     http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  package cmd
    18  
    19  import (
    20  	"sync"
    21  	"testing/quick"
    22  
    23  	"storj.io/minio/cmd/config"
    24  	"storj.io/minio/cmd/config/cache"
    25  	"storj.io/minio/cmd/config/compress"
    26  	xldap "storj.io/minio/cmd/config/identity/ldap"
    27  	"storj.io/minio/cmd/config/identity/openid"
    28  	"storj.io/minio/cmd/config/notify"
    29  	"storj.io/minio/cmd/config/policy/opa"
    30  	"storj.io/minio/cmd/config/storageclass"
    31  	"storj.io/minio/cmd/logger"
    32  	"storj.io/minio/pkg/auth"
    33  	"storj.io/minio/pkg/event/target"
    34  )
    35  
    36  /////////////////// Config V1 ///////////////////
    37  type configV1 struct {
    38  	Version   string `json:"version"`
    39  	AccessKey string `json:"accessKeyId"`
    40  	SecretKey string `json:"secretAccessKey"`
    41  }
    42  
    43  /////////////////// Config V2 ///////////////////
    44  type configV2 struct {
    45  	Version     string `json:"version"`
    46  	Credentials struct {
    47  		AccessKey string `json:"accessKeyId"`
    48  		SecretKey string `json:"secretAccessKey"`
    49  		Region    string `json:"region"`
    50  	} `json:"credentials"`
    51  	MongoLogger struct {
    52  		Addr       string `json:"addr"`
    53  		DB         string `json:"db"`
    54  		Collection string `json:"collection"`
    55  	} `json:"mongoLogger"`
    56  	SyslogLogger struct {
    57  		Network string `json:"network"`
    58  		Addr    string `json:"addr"`
    59  	} `json:"syslogLogger"`
    60  	FileLogger struct {
    61  		Filename string `json:"filename"`
    62  	} `json:"fileLogger"`
    63  }
    64  
    65  /////////////////// Config V3 ///////////////////
    66  // backendV3 type.
    67  type backendV3 struct {
    68  	Type  string   `json:"type"`
    69  	Disk  string   `json:"disk,omitempty"`
    70  	Disks []string `json:"disks,omitempty"`
    71  }
    72  
    73  // syslogLogger v3
    74  type syslogLoggerV3 struct {
    75  	Enable bool   `json:"enable"`
    76  	Addr   string `json:"address"`
    77  	Level  string `json:"level"`
    78  }
    79  
    80  // loggerV3 type.
    81  type loggerV3 struct {
    82  	Console struct {
    83  		Enable bool   `json:"enable"`
    84  		Level  string `json:"level"`
    85  	}
    86  	File struct {
    87  		Enable   bool   `json:"enable"`
    88  		Filename string `json:"fileName"`
    89  		Level    string `json:"level"`
    90  	}
    91  	Syslog struct {
    92  		Enable bool   `json:"enable"`
    93  		Addr   string `json:"address"`
    94  		Level  string `json:"level"`
    95  	} `json:"syslog"`
    96  	// Add new loggers here.
    97  }
    98  
    99  // configV3 server configuration version '3'.
   100  type configV3 struct {
   101  	Version string `json:"version"`
   102  
   103  	// Backend configuration.
   104  	Backend backendV3 `json:"backend"`
   105  
   106  	// http Server configuration.
   107  	Addr string `json:"address"`
   108  
   109  	// S3 API configuration.
   110  	Credential auth.Credentials `json:"credential"`
   111  	Region     string           `json:"region"`
   112  
   113  	// Additional error logging configuration.
   114  	Logger loggerV3 `json:"logger"`
   115  }
   116  
   117  // logger type representing version '4' logger config.
   118  type loggerV4 struct {
   119  	Console struct {
   120  		Enable bool   `json:"enable"`
   121  		Level  string `json:"level"`
   122  	} `json:"console"`
   123  	File struct {
   124  		Enable   bool   `json:"enable"`
   125  		Filename string `json:"fileName"`
   126  		Level    string `json:"level"`
   127  	} `json:"file"`
   128  	Syslog struct {
   129  		Enable bool   `json:"enable"`
   130  		Addr   string `json:"address"`
   131  		Level  string `json:"level"`
   132  	} `json:"syslog"`
   133  }
   134  
   135  // configV4 server configuration version '4'.
   136  type configV4 struct {
   137  	Version string `json:"version"`
   138  
   139  	// S3 API configuration.
   140  	Credential auth.Credentials `json:"credential"`
   141  	Region     string           `json:"region"`
   142  
   143  	// Additional error logging configuration.
   144  	Logger loggerV4 `json:"logger"`
   145  }
   146  
   147  // logger type representing version '5' logger config.
   148  type loggerV5 struct {
   149  	Console struct {
   150  		Enable bool   `json:"enable"`
   151  		Level  string `json:"level"`
   152  	} `json:"console"`
   153  	File struct {
   154  		Enable   bool   `json:"enable"`
   155  		Filename string `json:"fileName"`
   156  		Level    string `json:"level"`
   157  	} `json:"file"`
   158  	Syslog struct {
   159  		Enable bool   `json:"enable"`
   160  		Addr   string `json:"address"`
   161  		Level  string `json:"level"`
   162  	} `json:"syslog"`
   163  	AMQP struct {
   164  		Enable       bool   `json:"enable"`
   165  		Level        string `json:"level"`
   166  		URL          string `json:"url"`
   167  		Exchange     string `json:"exchange"`
   168  		RoutingKey   string `json:"routingKey"`
   169  		ExchangeType string `json:"exchangeType"`
   170  		Mandatory    bool   `json:"mandatory"`
   171  		Immediate    bool   `json:"immediate"`
   172  		Durable      bool   `json:"durable"`
   173  		Internal     bool   `json:"internal"`
   174  		NoWait       bool   `json:"noWait"`
   175  		AutoDeleted  bool   `json:"autoDeleted"`
   176  	} `json:"amqp"`
   177  	ElasticSearch struct {
   178  		Enable bool   `json:"enable"`
   179  		Level  string `json:"level"`
   180  		URL    string `json:"url"`
   181  		Index  string `json:"index"`
   182  	} `json:"elasticsearch"`
   183  	Redis struct {
   184  		Enable   bool   `json:"enable"`
   185  		Level    string `json:"level"`
   186  		Addr     string `json:"address"`
   187  		Password string `json:"password"`
   188  		Key      string `json:"key"`
   189  	} `json:"redis"`
   190  }
   191  
   192  // configV5 server configuration version '5'.
   193  type configV5 struct {
   194  	Version string `json:"version"`
   195  
   196  	// S3 API configuration.
   197  	Credential auth.Credentials `json:"credential"`
   198  	Region     string           `json:"region"`
   199  
   200  	// Additional error logging configuration.
   201  	Logger loggerV5 `json:"logger"`
   202  }
   203  
   204  // consoleLogger - default logger if not other logging is enabled.
   205  type consoleLoggerV1 struct {
   206  	Enable bool   `json:"enable"`
   207  	Level  string `json:"level"`
   208  }
   209  
   210  type fileLoggerV1 struct {
   211  	Enable   bool   `json:"enable"`
   212  	Filename string `json:"fileName"`
   213  	Level    string `json:"level"`
   214  }
   215  
   216  type loggerV6 struct {
   217  	Console consoleLoggerV1 `json:"console"`
   218  	File    fileLoggerV1    `json:"file"`
   219  	Syslog  syslogLoggerV3  `json:"syslog"`
   220  }
   221  
   222  // configV6 server configuration version '6'.
   223  type configV6 struct {
   224  	Version string `json:"version"`
   225  
   226  	// S3 API configuration.
   227  	Credential auth.Credentials `json:"credential"`
   228  	Region     string           `json:"region"`
   229  
   230  	// Additional error logging configuration.
   231  	Logger loggerV6 `json:"logger"`
   232  
   233  	// Notification queue configuration.
   234  	Notify notifierV1 `json:"notify"`
   235  }
   236  
   237  // Notifier represents collection of supported notification queues in version
   238  // 1 without NATS streaming.
   239  type notifierV1 struct {
   240  	AMQP          map[string]target.AMQPArgs          `json:"amqp"`
   241  	NATS          map[string]natsNotifyV1             `json:"nats"`
   242  	ElasticSearch map[string]target.ElasticsearchArgs `json:"elasticsearch"`
   243  	Redis         map[string]target.RedisArgs         `json:"redis"`
   244  	PostgreSQL    map[string]target.PostgreSQLArgs    `json:"postgresql"`
   245  	Kafka         map[string]target.KafkaArgs         `json:"kafka"`
   246  }
   247  
   248  // Notifier represents collection of supported notification queues in version 2
   249  // with NATS streaming but without webhook.
   250  type notifierV2 struct {
   251  	AMQP          map[string]target.AMQPArgs          `json:"amqp"`
   252  	NATS          map[string]target.NATSArgs          `json:"nats"`
   253  	ElasticSearch map[string]target.ElasticsearchArgs `json:"elasticsearch"`
   254  	Redis         map[string]target.RedisArgs         `json:"redis"`
   255  	PostgreSQL    map[string]target.PostgreSQLArgs    `json:"postgresql"`
   256  	Kafka         map[string]target.KafkaArgs         `json:"kafka"`
   257  }
   258  
   259  // configV7 server configuration version '7'.
   260  type serverConfigV7 struct {
   261  	Version string `json:"version"`
   262  
   263  	// S3 API configuration.
   264  	Credential auth.Credentials `json:"credential"`
   265  	Region     string           `json:"region"`
   266  
   267  	// Additional error logging configuration.
   268  	Logger loggerV6 `json:"logger"`
   269  
   270  	// Notification queue configuration.
   271  	Notify notifierV1 `json:"notify"`
   272  }
   273  
   274  // serverConfigV8 server configuration version '8'. Adds NATS notify.Config
   275  // configuration.
   276  type serverConfigV8 struct {
   277  	Version string `json:"version"`
   278  
   279  	// S3 API configuration.
   280  	Credential auth.Credentials `json:"credential"`
   281  	Region     string           `json:"region"`
   282  
   283  	// Additional error logging configuration.
   284  	Logger loggerV6 `json:"logger"`
   285  
   286  	// Notification queue configuration.
   287  	Notify notifierV1 `json:"notify"`
   288  }
   289  
   290  // serverConfigV9 server configuration version '9'. Adds PostgreSQL
   291  // notify.Config configuration.
   292  type serverConfigV9 struct {
   293  	Version string `json:"version"`
   294  
   295  	// S3 API configuration.
   296  	Credential auth.Credentials `json:"credential"`
   297  	Region     string           `json:"region"`
   298  
   299  	// Additional error logging configuration.
   300  	Logger loggerV6 `json:"logger"`
   301  
   302  	// Notification queue configuration.
   303  	Notify notifierV1 `json:"notify"`
   304  }
   305  
   306  type loggerV7 struct {
   307  	sync.RWMutex
   308  	Console consoleLoggerV1 `json:"console"`
   309  	File    fileLoggerV1    `json:"file"`
   310  }
   311  
   312  // serverConfigV10 server configuration version '10' which is like
   313  // version '9' except it drops support of syslog config, and makes the
   314  // RWMutex global (so it does not exist in this struct).
   315  type serverConfigV10 struct {
   316  	Version string `json:"version"`
   317  
   318  	// S3 API configuration.
   319  	Credential auth.Credentials `json:"credential"`
   320  	Region     string           `json:"region"`
   321  
   322  	// Additional error logging configuration.
   323  	Logger loggerV7 `json:"logger"`
   324  
   325  	// Notification queue configuration.
   326  	Notify notifierV1 `json:"notify"`
   327  }
   328  
   329  // natsNotifyV1 - structure was valid until config V 11
   330  type natsNotifyV1 struct {
   331  	Enable       bool   `json:"enable"`
   332  	Address      string `json:"address"`
   333  	Subject      string `json:"subject"`
   334  	Username     string `json:"username"`
   335  	Password     string `json:"password"`
   336  	Token        string `json:"token"`
   337  	Secure       bool   `json:"secure"`
   338  	PingInterval int64  `json:"pingInterval"`
   339  }
   340  
   341  // serverConfigV11 server configuration version '11' which is like
   342  // version '10' except it adds support for Kafka notifications.
   343  type serverConfigV11 struct {
   344  	Version string `json:"version"`
   345  
   346  	// S3 API configuration.
   347  	Credential auth.Credentials `json:"credential"`
   348  	Region     string           `json:"region"`
   349  
   350  	// Additional error logging configuration.
   351  	Logger loggerV7 `json:"logger"`
   352  
   353  	// Notification queue configuration.
   354  	Notify notifierV1 `json:"notify"`
   355  }
   356  
   357  // serverConfigV12 server configuration version '12' which is like
   358  // version '11' except it adds support for NATS streaming notifications.
   359  type serverConfigV12 struct {
   360  	Version string `json:"version"`
   361  
   362  	// S3 API configuration.
   363  	Credential auth.Credentials `json:"credential"`
   364  	Region     string           `json:"region"`
   365  
   366  	// Additional error logging configuration.
   367  	Logger loggerV7 `json:"logger"`
   368  
   369  	// Notification queue configuration.
   370  	Notify notifierV2 `json:"notify"`
   371  }
   372  
   373  type notifierV3 struct {
   374  	AMQP          map[string]target.AMQPArgs          `json:"amqp"`
   375  	Elasticsearch map[string]target.ElasticsearchArgs `json:"elasticsearch"`
   376  	Kafka         map[string]target.KafkaArgs         `json:"kafka"`
   377  	MQTT          map[string]target.MQTTArgs          `json:"mqtt"`
   378  	MySQL         map[string]target.MySQLArgs         `json:"mysql"`
   379  	NATS          map[string]target.NATSArgs          `json:"nats"`
   380  	PostgreSQL    map[string]target.PostgreSQLArgs    `json:"postgresql"`
   381  	Redis         map[string]target.RedisArgs         `json:"redis"`
   382  	Webhook       map[string]target.WebhookArgs       `json:"webhook"`
   383  }
   384  
   385  // serverConfigV13 server configuration version '13' which is like
   386  // version '12' except it adds support for webhook notification.
   387  type serverConfigV13 struct {
   388  	Version string `json:"version"`
   389  
   390  	// S3 API configuration.
   391  	Credential auth.Credentials `json:"credential"`
   392  	Region     string           `json:"region"`
   393  
   394  	// Additional error logging configuration.
   395  	Logger *loggerV7 `json:"logger"`
   396  
   397  	// Notification queue configuration.
   398  	Notify *notifierV3 `json:"notify"`
   399  }
   400  
   401  // serverConfigV14 server configuration version '14' which is like
   402  // version '13' except it adds support of browser param.
   403  type serverConfigV14 struct {
   404  	Version string `json:"version"`
   405  
   406  	// S3 API configuration.
   407  	Credential auth.Credentials `json:"credential"`
   408  	Region     string           `json:"region"`
   409  	Browser    config.BoolFlag  `json:"browser"`
   410  
   411  	// Additional error logging configuration.
   412  	Logger *loggerV7 `json:"logger"`
   413  
   414  	// Notification queue configuration.
   415  	Notify *notifierV3 `json:"notify"`
   416  }
   417  
   418  // serverConfigV15 server configuration version '15' which is like
   419  // version '14' except it adds mysql support
   420  type serverConfigV15 struct {
   421  	Version string `json:"version"`
   422  
   423  	// S3 API configuration.
   424  	Credential auth.Credentials `json:"credential"`
   425  	Region     string           `json:"region"`
   426  	Browser    config.BoolFlag  `json:"browser"`
   427  
   428  	// Additional error logging configuration.
   429  	Logger *loggerV7 `json:"logger"`
   430  
   431  	// Notification queue configuration.
   432  	Notify *notifierV3 `json:"notify"`
   433  }
   434  
   435  // FileLogger is introduced to workaround the dependency about logrus
   436  type FileLogger struct {
   437  	Enable   bool   `json:"enable"`
   438  	Filename string `json:"filename"`
   439  }
   440  
   441  // ConsoleLogger is introduced to workaround the dependency about logrus
   442  type ConsoleLogger struct {
   443  	Enable bool `json:"enable"`
   444  }
   445  
   446  // Loggers struct is defined with FileLogger and ConsoleLogger
   447  // although they are removed from logging logic. They are
   448  // kept here just to workaround the dependency migration
   449  // code/logic has on them.
   450  type loggers struct {
   451  	sync.RWMutex
   452  	Console ConsoleLogger `json:"console"`
   453  	File    FileLogger    `json:"file"`
   454  }
   455  
   456  // serverConfigV16 server configuration version '16' which is like
   457  // version '15' except it makes a change to logging configuration.
   458  type serverConfigV16 struct {
   459  	Version string `json:"version"`
   460  
   461  	// S3 API configuration.
   462  	Credential auth.Credentials `json:"credential"`
   463  	Region     string           `json:"region"`
   464  	Browser    config.BoolFlag  `json:"browser"`
   465  
   466  	// Additional error logging configuration.
   467  	Logger *loggers `json:"logger"`
   468  
   469  	// Notification queue configuration.
   470  	Notify *notifierV3 `json:"notify"`
   471  }
   472  
   473  // serverConfigV17 server configuration version '17' which is like
   474  // version '16' except it adds support for "format" parameter in
   475  // database event notification targets: PostgreSQL, MySQL, Redis and
   476  // Elasticsearch.
   477  type serverConfigV17 struct {
   478  	Version string `json:"version"`
   479  
   480  	// S3 API configuration.
   481  	Credential auth.Credentials `json:"credential"`
   482  	Region     string           `json:"region"`
   483  	Browser    config.BoolFlag  `json:"browser"`
   484  
   485  	// Additional error logging configuration.
   486  	Logger *loggers `json:"logger"`
   487  
   488  	// Notification queue configuration.
   489  	Notify *notifierV3 `json:"notify"`
   490  }
   491  
   492  // serverConfigV18 server configuration version '18' which is like
   493  // version '17' except it adds support for "deliveryMode" parameter in
   494  // the AMQP notification target.
   495  type serverConfigV18 struct {
   496  	sync.RWMutex
   497  	Version string `json:"version"`
   498  
   499  	// S3 API configuration.
   500  	Credential auth.Credentials `json:"credential"`
   501  	Region     string           `json:"region"`
   502  	Browser    config.BoolFlag  `json:"browser"`
   503  
   504  	// Additional error logging configuration.
   505  	Logger *loggers `json:"logger"`
   506  
   507  	// Notification queue configuration.
   508  	Notify *notifierV3 `json:"notify"`
   509  }
   510  
   511  // serverConfigV19 server configuration version '19' which is like
   512  // version '18' except it adds support for MQTT notifications.
   513  type serverConfigV19 struct {
   514  	sync.RWMutex
   515  	Version string `json:"version"`
   516  
   517  	// S3 API configuration.
   518  	Credential auth.Credentials `json:"credential"`
   519  	Region     string           `json:"region"`
   520  	Browser    config.BoolFlag  `json:"browser"`
   521  
   522  	// Additional error logging configuration.
   523  	Logger *loggers `json:"logger"`
   524  
   525  	// Notification queue configuration.
   526  	Notify *notifierV3 `json:"notify"`
   527  }
   528  
   529  // serverConfigV20 server configuration version '20' which is like
   530  // version '19' except it adds support for VirtualHostDomain
   531  type serverConfigV20 struct {
   532  	sync.RWMutex
   533  	Version string `json:"version"`
   534  
   535  	// S3 API configuration.
   536  	Credential auth.Credentials `json:"credential"`
   537  	Region     string           `json:"region"`
   538  	Browser    config.BoolFlag  `json:"browser"`
   539  	Domain     string           `json:"domain"`
   540  
   541  	// Additional error logging configuration.
   542  	Logger *loggers `json:"logger"`
   543  
   544  	// Notification queue configuration.
   545  	Notify *notifierV3 `json:"notify"`
   546  }
   547  
   548  // serverConfigV21 is just like version '20' without logger field
   549  type serverConfigV21 struct {
   550  	sync.RWMutex
   551  	Version string `json:"version"`
   552  
   553  	// S3 API configuration.
   554  	Credential auth.Credentials `json:"credential"`
   555  	Region     string           `json:"region"`
   556  	Browser    config.BoolFlag  `json:"browser"`
   557  	Domain     string           `json:"domain"`
   558  
   559  	// Notification queue configuration.
   560  	Notify *notifierV3 `json:"notify"`
   561  }
   562  
   563  // serverConfigV22 is just like version '21' with added support
   564  // for StorageClass.
   565  type serverConfigV22 struct {
   566  	Version string `json:"version"`
   567  
   568  	// S3 API configuration.
   569  	Credential auth.Credentials `json:"credential"`
   570  	Region     string           `json:"region"`
   571  	Browser    config.BoolFlag  `json:"browser"`
   572  	Domain     string           `json:"domain"`
   573  
   574  	// Storage class configuration
   575  	StorageClass storageclass.Config `json:"storageclass"`
   576  
   577  	// Notification queue configuration.
   578  	Notify notifierV3 `json:"notify"`
   579  }
   580  
   581  // serverConfigV23 is just like version '22' with addition of cache field.
   582  type serverConfigV23 struct {
   583  	Version string `json:"version"`
   584  
   585  	// S3 API configuration.
   586  	Credential auth.Credentials `json:"credential"`
   587  	Region     string           `json:"region"`
   588  	Browser    config.BoolFlag  `json:"browser"`
   589  	Domain     string           `json:"domain"`
   590  
   591  	// Storage class configuration
   592  	StorageClass storageclass.Config `json:"storageclass"`
   593  
   594  	// Cache configuration
   595  	Cache cache.Config `json:"cache"`
   596  
   597  	// Notification queue configuration.
   598  	Notify notifierV3 `json:"notify"`
   599  }
   600  
   601  // serverConfigV24 is just like version '23', we had to revert
   602  // the changes which were made in 6fb06045028b7a57c37c60a612c8e50735279ab4
   603  type serverConfigV24 struct {
   604  	Version string `json:"version"`
   605  
   606  	// S3 API configuration.
   607  	Credential auth.Credentials `json:"credential"`
   608  	Region     string           `json:"region"`
   609  	Browser    config.BoolFlag  `json:"browser"`
   610  	Domain     string           `json:"domain"`
   611  
   612  	// Storage class configuration
   613  	StorageClass storageclass.Config `json:"storageclass"`
   614  
   615  	// Cache configuration
   616  	Cache cache.Config `json:"cache"`
   617  
   618  	// Notification queue configuration.
   619  	Notify notifierV3 `json:"notify"`
   620  }
   621  
   622  // serverConfigV25 is just like version '24', stores additionally
   623  // worm variable.
   624  type serverConfigV25 struct {
   625  	quick.Config `json:"-"` // ignore interfaces
   626  
   627  	Version string `json:"version"`
   628  
   629  	// S3 API configuration.
   630  	Credential auth.Credentials `json:"credential"`
   631  	Region     string           `json:"region"`
   632  	Browser    config.BoolFlag  `json:"browser"`
   633  	Worm       config.BoolFlag  `json:"worm"`
   634  	Domain     string           `json:"domain"`
   635  
   636  	// Storage class configuration
   637  	StorageClass storageclass.Config `json:"storageclass"`
   638  
   639  	// Cache configuration
   640  	Cache cache.Config `json:"cache"`
   641  
   642  	// Notification queue configuration.
   643  	Notify notifierV3 `json:"notify"`
   644  }
   645  
   646  // serverConfigV26 is just like version '25', stores additionally
   647  // cache max use value in 'cache.Config'.
   648  type serverConfigV26 struct {
   649  	quick.Config `json:"-"` // ignore interfaces
   650  
   651  	Version string `json:"version"`
   652  
   653  	// S3 API configuration.
   654  	Credential auth.Credentials `json:"credential"`
   655  	Region     string           `json:"region"`
   656  	Browser    config.BoolFlag  `json:"browser"`
   657  	Worm       config.BoolFlag  `json:"worm"`
   658  	Domain     string           `json:"domain"`
   659  
   660  	// Storage class configuration
   661  	StorageClass storageclass.Config `json:"storageclass"`
   662  
   663  	// Cache configuration
   664  	Cache cache.Config `json:"cache"`
   665  
   666  	// Notification queue configuration.
   667  	Notify notifierV3 `json:"notify"`
   668  }
   669  
   670  // serverConfigV27 is just like version '26', stores additionally
   671  // the logger field
   672  type serverConfigV27 struct {
   673  	quick.Config `json:"-"` // ignore interfaces
   674  
   675  	Version string `json:"version"`
   676  
   677  	// S3 API configuration.
   678  	Credential auth.Credentials `json:"credential"`
   679  	Region     string           `json:"region"`
   680  	Browser    config.BoolFlag  `json:"browser"`
   681  	Worm       config.BoolFlag  `json:"worm"`
   682  	Domain     string           `json:"domain"`
   683  
   684  	// Storage class configuration
   685  	StorageClass storageclass.Config `json:"storageclass"`
   686  
   687  	// Cache configuration
   688  	Cache cache.Config `json:"cache"`
   689  
   690  	// Notification queue configuration.
   691  	Notify notifierV3 `json:"notify"`
   692  
   693  	// Logger configuration
   694  	Logger logger.Config `json:"logger"`
   695  }
   696  
   697  // serverConfigV28 is just like version '27', additionally
   698  // storing KMS config
   699  type serverConfigV28 struct {
   700  	quick.Config `json:"-"` // ignore interfaces
   701  
   702  	Version string `json:"version"`
   703  
   704  	// S3 API configuration.
   705  	Credential auth.Credentials `json:"credential"`
   706  	Region     string           `json:"region"`
   707  	Worm       config.BoolFlag  `json:"worm"`
   708  
   709  	// Storage class configuration
   710  	StorageClass storageclass.Config `json:"storageclass"`
   711  
   712  	// Cache configuration
   713  	Cache cache.Config `json:"cache"`
   714  
   715  	// Notification queue configuration.
   716  	Notify notifierV3 `json:"notify"`
   717  
   718  	// Logger configuration
   719  	Logger logger.Config `json:"logger"`
   720  }
   721  
   722  // serverConfigV29 is just like version '28'.
   723  type serverConfigV29 serverConfigV28
   724  
   725  // serverConfigV30 is just like version '29', stores additionally
   726  // extensions and mimetypes fields for compression.
   727  type serverConfigV30 struct {
   728  	Version string `json:"version"`
   729  
   730  	// S3 API configuration.
   731  	Credential auth.Credentials `json:"credential"`
   732  	Region     string           `json:"region"`
   733  	Worm       config.BoolFlag  `json:"worm"`
   734  
   735  	// Storage class configuration
   736  	StorageClass storageclass.Config `json:"storageclass"`
   737  
   738  	// Cache configuration
   739  	Cache cache.Config `json:"cache"`
   740  
   741  	// Notification queue configuration.
   742  	Notify notifierV3 `json:"notify"`
   743  
   744  	// Logger configuration
   745  	Logger logger.Config `json:"logger"`
   746  
   747  	// Compression configuration
   748  	Compression compress.Config `json:"compress"`
   749  }
   750  
   751  // serverConfigV31 is just like version '30', with OPA and OpenID configuration.
   752  type serverConfigV31 struct {
   753  	Version string `json:"version"`
   754  
   755  	// S3 API configuration.
   756  	Credential auth.Credentials `json:"credential"`
   757  	Region     string           `json:"region"`
   758  	Worm       config.BoolFlag  `json:"worm"`
   759  
   760  	// Storage class configuration
   761  	StorageClass storageclass.Config `json:"storageclass"`
   762  
   763  	// Cache configuration
   764  	Cache cache.Config `json:"cache"`
   765  
   766  	// Notification queue configuration.
   767  	Notify notifierV3 `json:"notify"`
   768  
   769  	// Logger configuration
   770  	Logger logger.Config `json:"logger"`
   771  
   772  	// Compression configuration
   773  	Compression compress.Config `json:"compress"`
   774  
   775  	// OpenID configuration
   776  	OpenID openid.Config `json:"openid"`
   777  
   778  	// External policy enforcements.
   779  	Policy struct {
   780  		// OPA configuration.
   781  		OPA opa.Args `json:"opa"`
   782  
   783  		// Add new external policy enforcements here.
   784  	} `json:"policy"`
   785  }
   786  
   787  // serverConfigV32 is just like version '31' with added nsq notifer.
   788  type serverConfigV32 struct {
   789  	Version string `json:"version"`
   790  
   791  	// S3 API configuration.
   792  	Credential auth.Credentials `json:"credential"`
   793  	Region     string           `json:"region"`
   794  	Worm       config.BoolFlag  `json:"worm"`
   795  
   796  	// Storage class configuration
   797  	StorageClass storageclass.Config `json:"storageclass"`
   798  
   799  	// Cache configuration
   800  	Cache cache.Config `json:"cache"`
   801  
   802  	// Notification queue configuration.
   803  	Notify notify.Config `json:"notify"`
   804  
   805  	// Logger configuration
   806  	Logger logger.Config `json:"logger"`
   807  
   808  	// Compression configuration
   809  	Compression compress.Config `json:"compress"`
   810  
   811  	// OpenID configuration
   812  	OpenID openid.Config `json:"openid"`
   813  
   814  	// External policy enforcements.
   815  	Policy struct {
   816  		// OPA configuration.
   817  		OPA opa.Args `json:"opa"`
   818  
   819  		// Add new external policy enforcements here.
   820  	} `json:"policy"`
   821  }
   822  
   823  // serverConfigV33 is just like version '32', removes clientID from NATS and MQTT, and adds queueDir, queueLimit in all notification targets.
   824  type serverConfigV33 struct {
   825  	quick.Config `json:"-"` // ignore interfaces
   826  
   827  	Version string `json:"version"`
   828  
   829  	// S3 API configuration.
   830  	Credential auth.Credentials `json:"credential"`
   831  	Region     string           `json:"region"`
   832  	Worm       config.BoolFlag  `json:"worm"`
   833  
   834  	// Storage class configuration
   835  	StorageClass storageclass.Config `json:"storageclass"`
   836  
   837  	// Cache configuration
   838  	Cache cache.Config `json:"cache"`
   839  
   840  	// Notification queue configuration.
   841  	Notify notify.Config `json:"notify"`
   842  
   843  	// Logger configuration
   844  	Logger logger.Config `json:"logger"`
   845  
   846  	// Compression configuration
   847  	Compression compress.Config `json:"compress"`
   848  
   849  	// OpenID configuration
   850  	OpenID openid.Config `json:"openid"`
   851  
   852  	// External policy enforcements.
   853  	Policy struct {
   854  		// OPA configuration.
   855  		OPA opa.Args `json:"opa"`
   856  
   857  		// Add new external policy enforcements here.
   858  	} `json:"policy"`
   859  
   860  	LDAPServerConfig xldap.Config `json:"ldapserverconfig"`
   861  }