public object Get(string id) { DigestAuthId digestAuthId = new DigestAuthId(id); Site site = digestAuthId.SiteId == null ? null : SiteHelper.GetSite(digestAuthId.SiteId.Value); return(DigestAuthenticationHelper.ToJsonModel(site, digestAuthId.Path)); }
public object Get() { // Check if the scope of the request is for site or application Site site = ApplicationHelper.ResolveSite(); string path = ApplicationHelper.ResolvePath(); return(DigestAuthenticationHelper.ToJsonModel(site, path)); }
public async Task <object> Post() { if (DigestAuthenticationHelper.IsFeatureEnabled()) { throw new AlreadyExistsException(DigestAuthenticationHelper.FEATURE_NAME); } await DigestAuthenticationHelper.SetFeatureEnabled(true); dynamic auth = DigestAuthenticationHelper.ToJsonModel(null, null); return(Created(DigestAuthenticationHelper.GetLocation(auth.id), auth)); }
public object Patch(string id, [FromBody] dynamic model) { DigestAuthId digestAuthId = new DigestAuthId(id); Site site = digestAuthId.SiteId == null ? null : SiteHelper.GetSite(digestAuthId.SiteId.Value); // Targetting section for a site, but unable to find that site if (digestAuthId.SiteId != null && site == null) { return(NotFound()); } string configPath = model == null ? null : ManagementUnit.ResolveConfigScope(model); DigestAuthenticationHelper.UpdateSettings(model, site, digestAuthId.Path, configPath); ManagementUnit.Current.Commit(); return(DigestAuthenticationHelper.ToJsonModel(site, digestAuthId.Path)); }