public override bool IsAuthorized(ServiceInterface.Auth.IAuthSession session, ServiceInterface.Auth.IOAuthTokens tokens, ServiceInterface.Auth.Auth request = null) { if (request != null) { if (!LoginMatchesSession(session, request.UserName)) return false; } // For GoogleOpenId, AccessTokenSecret is null/empty, but UserId is populated w/ authenticated url from Google return tokens != null && !string.IsNullOrEmpty(tokens.UserId); }
/// <summary> /// 安装一个服务 /// </summary> /// <param name="service">需要安装的服务</param> /// <param name="SerivceName">需要安装的服务的名字</param> public static void InstallService(ServiceInterface service, string ServiceName) { Dictionary<string, ServiceInterface> sv = services; if (sv.ContainsKey(ServiceName)) { UnInstallSerive(ServiceName); } //启动服务 service.OnServiceStart(); sv.Add(ServiceName, service); }
public ComputeConnector(string uuid, string name, ServerConfiguration computeInfo) { UUID = uuid; Name = name; this.computeNodeInfo = computeInfo; serviceInterface = new ServiceInterface(computeNodeInfo.IpAddress, computeNodeInfo.Port); workers = new List<WorkerAdapter>(); for (int i = 0; i < computeInfo.PoolSize; i++) { var workerInfo = new WorkerAdapter(); workerInfo.Id = string.Format("Worker_{0}", i); workerInfo.Status = RunnerStatus.Idle; workerInfo.Connector = this; workers.Add(workerInfo); } }
/// <summary> /// Mapping for Update album request /// </summary> /// <param name="request">Album request</param> /// <returns>An Album</returns> public Core.Domain.Album ToAlbum(ServiceInterface.AlbumModel.UpdateAlbum request) { LogManager.GetLogger("").Info("Mapping for Update album request"); return Mapper.Map<Album>(request); }