Chore Account server

Check-in [1417716c42]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove redundant cookie check. Make title reflect SSL or not--makes bookmarks easier to spot
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:1417716c429811142bc19a97bf8d62e412f345ce624cbdda4656ed0859f5c2d0
User & Date: ajv-899-334-8894@vsta.org 2016-11-24 17:15:06
Context
2016-11-24
17:15
Log service registration. Don't let templates ever log in. Start applying per-user enforcement. Supply per-user profile to service. check-in: c1ba559bed user: ajv-899-334-8894@vsta.org tags: master, trunk
17:15
Remove redundant cookie check. Make title reflect SSL or not--makes bookmarks easier to spot check-in: 1417716c42 user: ajv-899-334-8894@vsta.org tags: master, trunk
17:14
Service name required check-in: 4b76e49189 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to get.py.

40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

56
57
58
59
60
61
62
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
        buf += "</form>\n"
        buf = self.build_tailer(buf)

        return self.send_result(buf, "text/html")

    # Show portal of services
    def send_portal(self):
        server = self.server
        app = server.approot

        # Shouldn't be here without a cookie
        res = self.auth_cookie()
        if res is not True:
            return self.send401("Not logged in")

        buf = self.build_header("Service Portal")

        buf += "<h3>Choose a service:</h3><br>\n"
        cfg = app.accts.get(self.user)
        if cfg is None:
            raise Exception, "Unknown account authenticated"
        services = cfg.get("serve")

        # Hostname they used to reach us, should be
................................................................................
                #  to build the URL our client can use to reach it.
                if nm not in app.services:
                    # Don't list services which are not started
                    continue

                # Port for non-SSL, then SSL
                sport = app.services[nm][1] \
                    [0 if not server.ssl else 1]

                # Service URL
                surl = "http%s://%s:%d" % \
                 (("s" if server.ssl else ""), host, sport)
                buf += ' <li><a href="%s">%s</a></li>\n' % (surl, nm)
                nservice += 1

            buf += "</ul>\n"

            # Edge case
            if not nservice:
                buf += '<h3>No services are running yet!</h3>'

        buf = self.build_tailer(buf)

        return self.send_result(buf, "text/html")







|
|

<
<
<
<
<
|
>







 







|



|












40
41
42
43
44
45
46
47
48
49





50
51
52
53
54
55
56
57
58
..
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
        buf += "</form>\n"
        buf = self.build_tailer(buf)

        return self.send_result(buf, "text/html")

    # Show portal of services
    def send_portal(self):
        srv = self.server
        app = srv.approot






        buf = self.build_header("%sService Portal" %
            ("SSL " if srv.ssl else "",))
        buf += "<h3>Choose a service:</h3><br>\n"
        cfg = app.accts.get(self.user)
        if cfg is None:
            raise Exception, "Unknown account authenticated"
        services = cfg.get("serve")

        # Hostname they used to reach us, should be
................................................................................
                #  to build the URL our client can use to reach it.
                if nm not in app.services:
                    # Don't list services which are not started
                    continue

                # Port for non-SSL, then SSL
                sport = app.services[nm][1] \
                    [0 if not srv.ssl else 1]

                # Service URL
                surl = "http%s://%s:%d" % \
                 (("s" if srv.ssl else ""), host, sport)
                buf += ' <li><a href="%s">%s</a></li>\n' % (surl, nm)
                nservice += 1

            buf += "</ul>\n"

            # Edge case
            if not nservice:
                buf += '<h3>No services are running yet!</h3>'

        buf = self.build_tailer(buf)

        return self.send_result(buf, "text/html")