Deprecation warning log message
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
This commit is contained in:
		@@ -192,7 +192,7 @@ func userMatchers(c *Config, logger log.Logger) []UserMatcher {
 | 
			
		||||
		return c.GroupSearch.UserMatchers
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	logger.Warn(`ldap: fields groupSearch userAttr/groupAttr are deprecated, use groupSearch.userMatchers instead.`)
 | 
			
		||||
	log.Deprecated(logger, `LDAP: use groupSearch.userMatchers option instead of "userAttr/groupAttr" fields.`)
 | 
			
		||||
	return []UserMatcher{
 | 
			
		||||
		{
 | 
			
		||||
			UserAttr:  c.GroupSearch.UserAttr,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										5
									
								
								pkg/log/deprecated.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								pkg/log/deprecated.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
package log
 | 
			
		||||
 | 
			
		||||
func Deprecated(logger Logger, f string, args ...interface{}) {
 | 
			
		||||
	logger.Warnf("Deprecated: "+f, args...)
 | 
			
		||||
}
 | 
			
		||||
@@ -11,6 +11,7 @@ import (
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/dexidp/dex/pkg/log"
 | 
			
		||||
	"github.com/dexidp/dex/storage"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@@ -152,7 +153,7 @@ func (s *Server) handleDeviceCode(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s *Server) handleDeviceTokenDeprecated(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
	s.logger.Warn(`The deprecated "/device/token" endpoint was called. It will be removed, use "/token" instead.`)
 | 
			
		||||
	log.Deprecated(s.logger, `The /device/token endpoint was called. It will be removed, use /token instead.`)
 | 
			
		||||
 | 
			
		||||
	w.Header().Set("Content-Type", "application/json")
 | 
			
		||||
	switch r.Method {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user