Auth (#1147)
Implement the Auth interface, with JWT and service implementations. * Update Auth Interface * Define Auth Service Implementation * Support Service Auth * Add Auth Service Proto * Remove erronious files * Implement Auth Service Package * Update Auth Interface * Update Auth Interface. Add Validate, remove Add/Remove roles * Make Revoke interface more explicit * Refactor serializing and deserializing service accounts * Fix srv name & update interface to be more explicit * Require jwt public key for auth * Rename Variables (Resource.ID => Resource.Name & ServiceAccount => Account) * Implement JWT Auth Package * Remove parent, add ID * Update auth imports to v2. Add String() to auth interface
This commit is contained in:
		
							
								
								
									
										34
									
								
								auth/default.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								auth/default.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| package auth | ||||
|  | ||||
| var ( | ||||
| 	DefaultAuth Auth = new(noop) | ||||
| ) | ||||
|  | ||||
| type noop struct { | ||||
| 	options Options | ||||
| } | ||||
|  | ||||
| // String name of implementation | ||||
| func (a *noop) String() string { | ||||
| 	return "noop" | ||||
| } | ||||
|  | ||||
| // Init the svc | ||||
| func (a *noop) Init(...Option) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Generate a new auth Account | ||||
| func (a *noop) Generate(id string, ops ...GenerateOption) (*Account, error) { | ||||
| 	return nil, nil | ||||
| } | ||||
|  | ||||
| // Revoke an authorization Account | ||||
| func (a *noop) Revoke(token string) error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Validate a  account token | ||||
| func (a *noop) Validate(token string) (*Account, error) { | ||||
| 	return nil, nil | ||||
| } | ||||
		Reference in New Issue
	
	Block a user