code: func (a Authority) MarshalJSON() ([]byte, error) {
  	switch a {
  	case AsAnonymous:
  		return asAnonymousJSON, nil
  	case AsService:
  		return asServiceJSON, nil
  	case AsUser:
  		return asUserJSON, nil
  	default:
  		return nil, errors.Reason("unknown authority: %v", a).Err()
  	}
  }
docs: // MarshalJSON implements encoding/json.Marshaler.
  //
  // We use a shorthand notation so that we don't waste space in JSON.