diff --git a/pkg/keystone/driver/cas/test/casfe.go b/pkg/keystone/driver/cas/test/casfe.go deleted file mode 100644 index 49f4bee1c3..0000000000 --- a/pkg/keystone/driver/cas/test/casfe.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2019 Yunion -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "context" - "fmt" - "net/http" - "os" - - "yunion.io/x/jsonutils" - - "yunion.io/x/onecloud/pkg/appsrv" - "yunion.io/x/onecloud/pkg/httperrors" - "yunion.io/x/onecloud/pkg/mcclient" - "yunion.io/x/onecloud/pkg/util/httputils" - "yunion.io/x/onecloud/pkg/util/netutils2" -) - -var ( - authUrl = "" // http://10.168.222.252:35357/v3 - casServer = "" // https://cas.example.org/cas - serviceUrl = "" // https://app.example.com -) - -func defaultPage(ctx context.Context, w http.ResponseWriter, r *http.Request) { - query, err := jsonutils.ParseQueryString(r.URL.RawQuery) - if err != nil { - httperrors.BadRequestError(w, "parse query fail %s", err) - return - } - if query.Contains("ticket") { - ticket, _ := query.GetString("ticket") - service := r.URL.Path - referer := r.Header.Get("Referer") - cliIp := netutils2.GetHttpRequestIp(r) - - cli := mcclient.NewClient(authUrl, 120, true, true, "", "") - token, err := cli.AuthenticateCAS(ticket, "", "", "", cliIp) - if err != nil { - httperrors.InvalidCredentialError(w, "cas auth error %s", err) - return - } - appsrv.SendHTML(w, fmt.Sprintf("