Beispiel #1
0
        public ActionResult <IDictionary <long, string> > Get([FromQuery(Name = "apikey")] string apikey)
        {
            if (!ActiveClientStorage.IsClientAccepted(apikey))
            {
                return(Forbid());
            }

            return(ImageStorage.GetImages());
        }
Beispiel #2
0
        public ActionResult Delete([FromQuery(Name = "apikey")] string apikey)
        {
            if (apikey != "12345")
            {
                return(Forbid());
            }

            ActiveClientStorage.Clear();
            return(Ok());
        }
Beispiel #3
0
        public ActionResult Post([FromBody] string passKey)
        {
            if (ComputeSha256Hash(passKey) == HashedPassKey)
            {
                Ok("");
            }

            var apiKey = ActiveClientStorage.AddClient();

            return(Ok(apiKey));
        }
Beispiel #4
0
 public ActionResult <IList <string> > Clients()
 {
     return(ActiveClientStorage.GetDebug());
 }